- removed ids in api enpoints as they are in JSON objects being sent

This commit is contained in:
2025-11-10 09:05:08 +00:00
parent d57ad1003a
commit a734de6261
7 changed files with 14 additions and 10 deletions

View File

@@ -27,7 +27,7 @@ const ChannelCard = ({ touched, isSubmitting, isBof2ConstantsLoading, isDispatch
connectTimeoutSeconds: Number(d?.propConnectTimeoutSeconds?.value), connectTimeoutSeconds: Number(d?.propConnectTimeoutSeconds?.value),
readTimeoutSeconds: Number(d?.propReadTimeoutSeconds?.value), readTimeoutSeconds: Number(d?.propReadTimeoutSeconds?.value),
}; };
}, [backOfficeQuery.data]); }, [backOfficeQuery?.data]);
useEffect(() => { useEffect(() => {
if (!backOfficeQuery?.isSuccess) return; if (!backOfficeQuery?.isSuccess) return;

View File

@@ -29,6 +29,7 @@ const SettingForms = () => {
const sightingQuality = sightingAmendQuery?.data?.propOverviewQuality?.value; const sightingQuality = sightingAmendQuery?.data?.propOverviewQuality?.value;
const cropSizeFactor = sightingAmendQuery?.data?.propOverviewImageScaleFactor?.value; const cropSizeFactor = sightingAmendQuery?.data?.propOverviewImageScaleFactor?.value;
const laneID = laneIdQuery?.data?.id;
const LID1 = laneIdQuery?.data?.propLaneID1?.value; const LID1 = laneIdQuery?.data?.propLaneID1?.value;
const LID2 = laneIdQuery?.data?.propLaneID2?.value; const LID2 = laneIdQuery?.data?.propLaneID2?.value;
@@ -58,6 +59,7 @@ const SettingForms = () => {
GPSFormat: GPSFormat ?? "", GPSFormat: GPSFormat ?? "",
//BOF2 - optional Lane IDs //BOF2 - optional Lane IDs
laneId: laneID ?? "",
LID1: LID1 ?? "", LID1: LID1 ?? "",
LID2: LID2 ?? "", LID2: LID2 ?? "",
}; };
@@ -109,6 +111,7 @@ const SettingForms = () => {
}; };
const bof2LaneData: OptionalBOF2LaneIDs = { const bof2LaneData: OptionalBOF2LaneIDs = {
laneId: laneIdQuery?.data?.id,
LID1: values.LID1, LID1: values.LID1,
LID2: values.LID2, LID2: values.LID2,
LID3: values.LID3, LID3: values.LID3,

View File

@@ -36,7 +36,7 @@ const updateBackOfficeConfig = async (data: InitialValuesForm) => {
}, },
], ],
}; };
const response = await fetch(`${CAM_BASE}/api/update-config?id=Dispatcher`, { const response = await fetch(`${CAM_BASE}/api/update-config`, {
method: "POST", method: "POST",
body: JSON.stringify(updateConfigPayload), body: JSON.stringify(updateConfigPayload),
}); });

View File

@@ -24,7 +24,7 @@ const updateDispatcherConfig = async (data: BearerTypeFieldType) => {
}, },
], ],
}; };
const response = await fetch(`${CAM_BASE}/api/update-config?id=Dispatcher`, { const response = await fetch(`${CAM_BASE}/api/update-config`, {
method: "POST", method: "POST",
body: JSON.stringify(updateConfigPayload), body: JSON.stringify(updateConfigPayload),
}); });
@@ -54,7 +54,7 @@ const updateBackOfficeDispatcher = async (data: OptionalBOF2Constants) => {
}, },
], ],
}; };
const response = await fetch(`${CAM_BASE}/api/update-config?id=Dispatcher-bof2-constants`, { const response = await fetch(`${CAM_BASE}/api/update-config`, {
method: "POST", method: "POST",
body: JSON.stringify(bof2ContantsPayload), body: JSON.stringify(bof2ContantsPayload),
}); });
@@ -70,7 +70,7 @@ const getBof2DispatcherData = async () => {
const updateBOF2LaneId = async (data: OptionalBOF2LaneIDs) => { const updateBOF2LaneId = async (data: OptionalBOF2LaneIDs) => {
const bof2LaneIds = { const bof2LaneIds = {
id: "SightingAmmendA-lane-ids", id: data?.laneId,
fields: [ fields: [
{ {
property: "propLaneID1", property: "propLaneID1",
@@ -83,7 +83,7 @@ const updateBOF2LaneId = async (data: OptionalBOF2LaneIDs) => {
], ],
}; };
const response = await fetch(`${CAM_BASE}/api/update-config?id=SightingAmmendA-lane-ids`, { const response = await fetch(`${CAM_BASE}/api/update-config`, {
method: "post", method: "post",
body: JSON.stringify(bof2LaneIds), body: JSON.stringify(bof2LaneIds),
}); });

View File

@@ -16,7 +16,7 @@ const getWiFiSettings = async () => {
}; };
const updateWifiSettings = async (wifiConfig: WifiConfig) => { const updateWifiSettings = async (wifiConfig: WifiConfig) => {
const response = await fetch(`${camBase}/api/update-config?id=ModemAndWifiManager-wifi`, { const response = await fetch(`${camBase}/api/update-config`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
body: JSON.stringify(wifiConfig), body: JSON.stringify(wifiConfig),
@@ -38,7 +38,7 @@ const getModemSettings = async () => {
}; };
const updateModemSettings = async (modemConfig: ModemConfig) => { const updateModemSettings = async (modemConfig: ModemConfig) => {
const response = await fetch(`${camBase}/api/update-config?id=ModemAndWifiManager-modem`, { const response = await fetch(`${camBase}/api/update-config`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
body: JSON.stringify(modemConfig), body: JSON.stringify(modemConfig),

View File

@@ -28,11 +28,11 @@ const updateDNSSettings = async (data: DNSSettingsType) => {
}, },
], ],
}; };
const response = await fetch(`${camBase}/api/update-config?id=GLOBAL--NetworkConfig`, { const response = await fetch(`${camBase}/api/update-config`, {
method: "post", method: "post",
body: JSON.stringify(dnsSettingsPayload), body: JSON.stringify(dnsSettingsPayload),
}); });
if (!response.ok) throw new Error("cannot send to dns endpoint"); if (!response.ok) throw new Error("cannot send to DNS endpoint");
return response.json(); return response.json();
}; };

View File

@@ -78,6 +78,7 @@ export type OptionalBOF2Constants = {
}; };
export type OptionalBOF2LaneIDs = { export type OptionalBOF2LaneIDs = {
laneId?: string;
LID1?: string; LID1?: string;
LID2?: string; LID2?: string;
LID3?: string; LID3?: string;