This commit is contained in:
2026-02-05 18:12:49 +08:00
commit 7ea280beb2
520 changed files with 169373 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import { useMutation } from "@tanstack/react-query";
import { removeFile } from "@/apis/file";
import { toast } from "sonner";
export const useRemoveFile = (mutationOptions?: any) => {
const { mutateAsync: removeMutateAsync, isPending: removeIsPending } =
useMutation({
mutationFn: removeFile,
...(mutationOptions || {}),
});
const remove = (id: number) => {
toast.promise(removeMutateAsync(id), {
loading: "删除中",
success: "删除成功",
});
};
return {
remove,
removeIsPending,
};
};