19 lines
464 B
TypeScript
19 lines
464 B
TypeScript
import { queryOptions } from "@tanstack/react-query";
|
|
import { ensureNativeApi } from "~/nativeApi";
|
|
|
|
export const serverQueryKeys = {
|
|
all: ["server"] as const,
|
|
config: () => ["server", "config"] as const,
|
|
};
|
|
|
|
export function serverConfigQueryOptions() {
|
|
return queryOptions({
|
|
queryKey: serverQueryKeys.config(),
|
|
queryFn: async () => {
|
|
const api = ensureNativeApi();
|
|
return api.server.getConfig();
|
|
},
|
|
staleTime: Infinity,
|
|
});
|
|
}
|