feat(modules): modules added to frontend
This commit is contained in:
17
frontend/src/lib/querys/admin/getModules.ts
Normal file
17
frontend/src/lib/querys/admin/getModules.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user