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,23 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import api from 'helpers/api';
export default function useUpdateFlowFolder(flowId) {
const queryClient = useQueryClient();
const mutation = useMutation({
mutationFn: async (folderId) => {
const { data } = await api.patch(`/v1/flows/${flowId}/folder`, {
folderId,
});
return data;
},
onSuccess: async () => {
await queryClient.invalidateQueries({
queryKey: ['flows', flowId, 'folder'],
});
},
});
return mutation;
}