Created
April 9, 2021 20:01
-
-
Save caioaao/d81285a17fa5476ee2d3043028dfc769 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
export const useCancelTask = (taskUUID: string) => { | |
const queryClient = useQueryClient(); | |
return useMutation( | |
() => ( | |
api.cancelTask(taskUUID).then(res => res.data) | |
), { | |
onSuccess: data => defaultOnSuccess(queryClient, data), | |
mutationKey: ["tasks", "cancel", {uuid: taskUUID}], | |
} | |
); | |
} |
This file contains hidden or 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
export const useCancelTask = () => { | |
const queryClient = useQueryClient(); | |
return useMutation( | |
(taskUUID: string) => ( | |
api.cancelTask(taskUUID).then(res => res.data) | |
), { | |
onSuccess: data => defaultOnSuccess(queryClient, data), | |
mutationKey: ["tasks", "cancel"], | |
} | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment