mutation fix
This commit is contained in:
@@ -125,13 +125,13 @@ export function useMutationAPI() {
|
|||||||
body: object | undefined | null;
|
body: object | undefined | null;
|
||||||
}) => callEndpoint(method, endpoint, body),
|
}) => callEndpoint(method, endpoint, body),
|
||||||
onMutate: ({ method, endpoint }) => {
|
onMutate: ({ method, endpoint }) => {
|
||||||
queryClient.resetQueries({
|
queryClient.refetchQueries({
|
||||||
queryKey: ['GET', endpoint],
|
queryKey: ['GET', endpoint],
|
||||||
force: true,
|
force: true,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onSuccess: (data, { method, endpoint }) => {
|
onSuccess: (data, { method, endpoint }) => {
|
||||||
queryClient.resetQueries({
|
queryClient.refetchQueries({
|
||||||
queryKey: ['GET', endpoint],
|
queryKey: ['GET', endpoint],
|
||||||
force: true,
|
force: true,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user