-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add pages edit for publish an admin activity
- Loading branch information
1 parent
c353e89
commit 9aeff9c
Showing
16 changed files
with
366 additions
and
86 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
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
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,18 @@ | ||
import { useMutation } from 'react-query'; | ||
|
||
import { axiosRequest } from 'src/utils/axiosRequest'; | ||
|
||
async function updateActivityPhase({ activityId, phase }: { activityId: number; phase: number }) { | ||
return await axiosRequest({ | ||
method: 'PUT', | ||
baseURL: '/api', | ||
url: `/activities/admin/${activityId}`, | ||
data: { phase }, | ||
}); | ||
} | ||
|
||
export const useUpdateActivityPhase = () => { | ||
return useMutation(({ activityId, phase }: { activityId: number; phase: number }) => { | ||
return updateActivityPhase({ activityId, phase }); | ||
}); | ||
}; |
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,22 @@ | ||
import { useQuery } from 'react-query'; | ||
|
||
import { axiosRequest } from 'src/utils/axiosRequest'; | ||
|
||
async function getChildrenActivitiesById(params: { id: number }) { | ||
const { id } = params; | ||
return ( | ||
await axiosRequest({ | ||
method: 'GET', | ||
baseURL: '/api', | ||
url: `/activities/children`, | ||
params: { | ||
id, | ||
}, | ||
}) | ||
).data; | ||
} | ||
|
||
export const useGetChildrenActivitiesById = (args: { id: number }) => { | ||
const { id } = args; | ||
return useQuery(['childrenActivities', id], () => getChildrenActivitiesById({ id })); | ||
}; |
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
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.