refactor(cards): messing with the time in the cards

This commit is contained in:
2025-04-17 18:41:40 -05:00
parent 9cb8ca6813
commit 5cdca0a41f
9 changed files with 388 additions and 8 deletions

View File

@@ -0,0 +1,22 @@
import { queryOptions } from "@tanstack/react-query";
import axios from "axios";
export function getOpenOrders() {
return queryOptions({
queryKey: ["getOpenOrders"],
queryFn: () => fetchStockSilo(),
//enabled:
staleTime: 1000,
refetchInterval: 1000 * 60 * 15,
refetchOnWindowFocus: true,
});
}
const fetchStockSilo = async () => {
const { data } = await axios.get(
`/api/datamart/getopenorders?sDay=15&eDay=45`
);
// if we are not localhost ignore the devDir setting.
//const url: string = window.location.host.split(":")[0];
return data.data ?? [];
};