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

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

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

	return data.data;
};
