import { queryOptions } from "@tanstack/react-query";
import axios from "axios";

export function getServers() {
	return queryOptions({
		queryKey: ["getServers"],
		queryFn: () => fetchSession(),
		staleTime: 5000,
		refetchOnWindowFocus: true,
	});
}

const fetchSession = async () => {
	const { data } = await axios.get("/lst/api/admin/server");

	return data.data;
};
