https://dev.kronoz.win/r/marzneshin.git
1import { useQuery } from "@tanstack/react-query";
2import { fetch } from "@marzneshin/common/utils";
3import { NodesQueryFetchKey } from "@marzneshin/modules/nodes";
4
5export async function fetchCertificate(): Promise<string> {
6 return fetch('/nodes/settings').then((settings) => {
7 return settings.certificate;
8 });
9}
10
11export const CertificateQueryFetchKey = "settings";
12
13export const useCertificateQuery = () => {
14 return useQuery({
15 queryKey: [NodesQueryFetchKey, CertificateQueryFetchKey],
16 queryFn: fetchCertificate,
17 initialData: ''
18 })
19}