fix: Refactor usePatchUpdateFlow mutation to include refetchQueries (#3736)

* refactor: Add refetchQueries to usePatchUpdateFlow mutation

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
anovazzi1 2024-09-10 16:55:58 -03:00 committed by GitHub
commit b6df370fcc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -33,7 +33,12 @@ export const usePatchUpdateFlow: useMutationFunctionType<
};
const mutation: UseMutationResult<IPatchUpdateFlow, any, IPatchUpdateFlow> =
mutate(["usePatchUpdateFlow"], PatchUpdateFlowFn, options);
mutate(["usePatchUpdateFlow"], PatchUpdateFlowFn, {
onSettled: () => {
queryClient.refetchQueries({ queryKey: ["useGetFolder"] });
},
...options,
});
return mutation;
};