fix: serde::json passing IVerge to the front end without deserialization

This commit is contained in:
huzibaca
2024-11-21 06:01:56 +08:00
parent cf3848f15d
commit cd1d719a92
6 changed files with 169 additions and 27 deletions

View File

@@ -4,7 +4,11 @@ import { getVergeConfig, patchVergeConfig } from "@/services/cmds";
export const useVerge = () => {
const { data: verge, mutate: mutateVerge } = useSWR(
"getVergeConfig",
getVergeConfig
async () => {
const config = await getVergeConfig();
console.log("Received verge config:", config);
return config;
},
);
const patchVerge = async (value: Partial<IVergeConfig>) => {