Files
papryk-com/front/src/hooks/video/useRefreshFiles.ts
Patryk Koreń 65303e655b cos tam dziala
2026-07-09 20:14:56 +02:00

19 lines
484 B
TypeScript

import { useMutation } from "@tanstack/react-query";
export function useRefreshFiles() {
return useMutation({
mutationFn: async () => {
const res = await fetch(`${import.meta.env.VITE_API_URL}/protected/refreshfiles`, {
method: "POST",
credentials: "include",
});
if (!res.ok) {
throw new Error("Invalid credentials");
}
return res.json();
},
});
}