mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? feat: call the reset api before opening the run drawer each time #918 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -164,3 +164,20 @@ export const useRunFlow = () => {
|
||||
|
||||
return { data, loading, runFlow: mutateAsync };
|
||||
};
|
||||
|
||||
export const useResetFlow = () => {
|
||||
const { id } = useParams();
|
||||
const {
|
||||
data,
|
||||
isPending: loading,
|
||||
mutateAsync,
|
||||
} = useMutation({
|
||||
mutationKey: ['resetFlow'],
|
||||
mutationFn: async () => {
|
||||
const { data } = await flowService.resetCanvas({ id });
|
||||
return data;
|
||||
},
|
||||
});
|
||||
|
||||
return { data, loading, resetFlow: mutateAsync };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user