add: template editor

This commit is contained in:
h z
2025-04-14 17:02:22 +01:00
parent 09338a2683
commit 947b59e3ea
29 changed files with 1277 additions and 166 deletions

View File

@@ -0,0 +1,19 @@
import {useQuery, useMutation, useQueryClient} from "react-query";
import {fetch_} from "../request-utils";
import {useConfig} from "../../ConfigProvider";
export const useTree = () => {
const queryClient = useQueryClient();
const config = useConfig();
return useQuery(
"tree",
() => fetch_(`${config.BACKEND_HOST}/api/tree/`),
{
onSuccess: data => {
if(data)
queryClient.setQueryData("tree", data);
}
}
);
}