- added store and forward
- amended sighting ammend endpoint
This commit is contained in:
@@ -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();
|
||||
};
|
||||
|
||||
@@ -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",
|
||||
|
||||
19
src/hooks/useStoreDispatch.ts
Normal file
19
src/hooks/useStoreDispatch.ts
Normal 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 };
|
||||
};
|
||||
Reference in New Issue
Block a user