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

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

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

	return data.data;
};
