-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove old-unused API layer functions
rename RcraProfile to RcrainfoProfile for clarity update RcraProfile serializer to allow blank/null RCRAInfo API ID and key, update with RTK query mutation
- Loading branch information
1 parent
986e904
commit 17863e0
Showing
33 changed files
with
275 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
client/src/components/RcraProfile/SyncRcrainfoProfileBtn.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { RcraApiUserBtn } from 'components/Rcrainfo'; | ||
import React, { useEffect } from 'react'; | ||
import { addTask, updateTask, useAppDispatch, useSyncRcrainfoProfileMutation } from 'store'; | ||
|
||
interface SyncRcrainfoProfileBtnProps { | ||
taskId?: string; | ||
setTaskId: (taskId: string) => void; | ||
} | ||
|
||
export function SyncRcrainfoProfileBtn({ taskId, setTaskId }: SyncRcrainfoProfileBtnProps) { | ||
const dispatch = useAppDispatch(); | ||
const [syncRcrainfoProfile, { data, error, isLoading }] = useSyncRcrainfoProfileMutation(); | ||
|
||
useEffect(() => { | ||
if (data) { | ||
dispatch( | ||
addTask({ | ||
taskId: data.taskId, | ||
status: 'PENDING', | ||
taskName: 'Syncing RCRAInfo Profile', | ||
}) | ||
); | ||
setTaskId(data.taskId); | ||
} | ||
if (error) { | ||
dispatch(updateTask({ taskId: taskId, status: 'FAILURE', complete: true })); | ||
} | ||
}, [data, error, isLoading]); | ||
|
||
return ( | ||
<RcraApiUserBtn | ||
className="mx-2" | ||
variant="primary" | ||
onClick={() => { | ||
syncRcrainfoProfile(); | ||
}} | ||
> | ||
Sync Site Permissions | ||
</RcraApiUserBtn> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export { htApi } from 'services/APIs/htApi'; | ||
export { UserApi } from 'services/APIs/UserApi'; | ||
export { manifest } from 'services/manifest/manifest'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.