create mutation
This commit is contained in:
parent
d34673a490
commit
35745d752d
@ -6,7 +6,7 @@ import { sendRequest } from './api';
|
||||
const useOfflineMutation = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const mutation = queryClient.setMutationDefaults(sendRequest, {
|
||||
queryClient.setMutationDefaults(['sendRequest'], {
|
||||
onMutate: async (newData) => {
|
||||
await queryClient.cancelQueries('data');
|
||||
|
||||
@ -24,6 +24,8 @@ const useOfflineMutation = () => {
|
||||
},
|
||||
});
|
||||
|
||||
const mutation = useMutation({mutationKey: ['sendRequest']});
|
||||
|
||||
return mutation;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user