improve: upgrade node to 20, upgrade react-query to v4

This commit is contained in:
h z
2025-04-27 00:36:42 +01:00
parent 9ea44385ee
commit 1ce2eebbfa
22 changed files with 309 additions and 218 deletions

View File

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