feat(web): introduce folders to organize flows

This commit is contained in:
Ali BARIN
2025-02-04 15:24:07 +00:00
parent e496e20c17
commit 8e7d06b5dc
18 changed files with 842 additions and 80 deletions

View File

@@ -0,0 +1,21 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import api from 'helpers/api';
export default function useUpdateFolder(folderId) {
const queryClient = useQueryClient();
const mutation = useMutation({
mutationFn: async (payload) => {
const { data } = await api.patch(`/v1/folders/${folderId}`, payload);
return data;
},
onSuccess: async () => {
await queryClient.invalidateQueries({
queryKey: ['folders'],
});
},
});
return mutation;
}