- removed ids in api enpoints as they are in JSON objects being sent
This commit is contained in:
@@ -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",
|
||||
body: JSON.stringify(updateConfigPayload),
|
||||
});
|
||||
|
||||
@@ -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",
|
||||
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",
|
||||
body: JSON.stringify(bof2ContantsPayload),
|
||||
});
|
||||
@@ -70,7 +70,7 @@ const getBof2DispatcherData = async () => {
|
||||
|
||||
const updateBOF2LaneId = async (data: OptionalBOF2LaneIDs) => {
|
||||
const bof2LaneIds = {
|
||||
id: "SightingAmmendA-lane-ids",
|
||||
id: data?.laneId,
|
||||
fields: [
|
||||
{
|
||||
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",
|
||||
body: JSON.stringify(bof2LaneIds),
|
||||
});
|
||||
|
||||
@@ -16,7 +16,7 @@ const getWiFiSettings = async () => {
|
||||
};
|
||||
|
||||
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",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(wifiConfig),
|
||||
@@ -38,7 +38,7 @@ const getModemSettings = async () => {
|
||||
};
|
||||
|
||||
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",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(modemConfig),
|
||||
|
||||
@@ -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",
|
||||
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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user