add react-query

This commit is contained in:
Julien Aldon
2026-02-10 17:21:26 +01:00
parent 7df0af8f1d
commit feea610d09
6 changed files with 53 additions and 6 deletions

View File

@@ -0,0 +1,10 @@
import { useQuery } from "@tanstack/react-query";
export function getForm(id: number) {
return useQuery({
queryKey: ['form'],
queryFn: () => (
fetch(`http://localhost:8000/forms/${id}`).then((res) => res.json())
),
});
}