feat(lstv2 move): moved lstv2 into this app to keep them combined and easier to maintain
This commit is contained in:
21
lstV2/frontend/src/utils/querys/production/lots.tsx
Normal file
21
lstV2/frontend/src/utils/querys/production/lots.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { queryOptions } from "@tanstack/react-query";
|
||||
import axios from "axios";
|
||||
|
||||
export function getlots() {
|
||||
return queryOptions({
|
||||
queryKey: ["lots"],
|
||||
queryFn: () => fetchSettings(),
|
||||
|
||||
staleTime: 10 * 1000,
|
||||
refetchInterval: 1000 * 10,
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
}
|
||||
|
||||
const fetchSettings = async () => {
|
||||
const { data } = await axios.get("/api/ocp/getlots");
|
||||
// if we are not localhost ignore the devDir setting.
|
||||
//const url: string = window.location.host.split(":")[0];
|
||||
let lotData = data.data;
|
||||
return lotData ?? [];
|
||||
};
|
||||
Reference in New Issue
Block a user