feat(lst): added update settings into the entire app

This commit is contained in:
2025-03-05 12:09:51 -06:00
parent 6fb615a743
commit 5fcadb9fc8
14 changed files with 601 additions and 29 deletions

View File

@@ -0,0 +1,17 @@
import {queryOptions} from "@tanstack/react-query";
import axios from "axios";
export function getSettings(token: string) {
return queryOptions({
queryKey: ["settings"],
queryFn: () => fetchSettings(token),
enabled: !!token,
staleTime: 1000,
refetchOnWindowFocus: true,
});
}
const fetchSettings = async (token: string) => {
const {data} = await axios.get("/api/server/settings", {headers: {Authorization: `Bearer ${token}`}});
return data.data;
};