- added store and forward

- amended sighting ammend endpoint
This commit is contained in:
2025-11-11 10:43:14 +00:00
parent cac9a2167d
commit f35e2f9fb5
6 changed files with 71 additions and 4 deletions

View File

@@ -92,7 +92,7 @@ const updateBOF2LaneId = async (data: OptionalBOF2LaneIDs) => {
};
const getBOF2LaneId = async () => {
const response = await fetch(`${CAM_BASE}/api/fetch-config?id=SightingAmmend-lane-ids`);
const response = await fetch(`${CAM_BASE}/api/fetch-config?id=SightingAmmendA-lane-ids`);
if (!response.ok) throw new Error("Canot get Lane Ids");
return response.json();
};

View File

@@ -3,14 +3,14 @@ import { CAM_BASE } from "../utils/config";
import type { InitialValuesForm } from "../types/types";
const getSightingAmend = async () => {
const response = await fetch(`${CAM_BASE}/api/fetch-config?id=SightingAmmend`);
const response = await fetch(`${CAM_BASE}/api/fetch-config?id=SightingAmmendA`);
if (!response.ok) throw new Error("Cannot reach sighting amend endpoint");
return response.json();
};
const updateSightingAmend = async (data: InitialValuesForm) => {
const updateSightingAmendPayload = {
id: "SightingAmmend",
id: "SightingAmmendA",
fields: [
{
property: "propOverviewQuality",

View File

@@ -0,0 +1,19 @@
import { useQuery } from "@tanstack/react-query";
import { CAM_BASE } from "../utils/config";
const getStoreData = async () => {
const response = await fetch(`${CAM_BASE}/Store/diagnostics-json`);
if (!response.ok) throw new Error("Cannot get store data");
return response.json();
};
export const useStoreDispatch = () => {
const storeQuery = useQuery({
queryKey: ["getStoreData"],
queryFn: getStoreData,
refetchInterval: 1000,
refetchOnWindowFocus: true,
});
return { storeQuery };
};