feat(scan users): added in the place to add the new scanner users in

This commit is contained in:
2026-05-11 15:37:38 -05:00
parent 1bbf5c2a49
commit ce9d8eaaf5
8 changed files with 685 additions and 66 deletions

View File

@@ -0,0 +1,25 @@
import { keepPreviousData, queryOptions } from "@tanstack/react-query";
import axios from "axios";
export function getScannerIds() {
return queryOptions({
queryKey: ["getScannerIds"],
queryFn: () => fetch(),
staleTime: 5000,
refetchOnWindowFocus: true,
placeholderData: keepPreviousData,
});
}
const fetch = async () => {
if (window.location.hostname === "localhost") {
await new Promise((res) => setTimeout(res, 1500));
}
const { data } = await axios.get("/lst/api/mobile/available", {
withCredentials: true,
timeout: 5000,
});
return data.data;
};