- Disabled camera settings form
- updated Config payload to update RSTP
This commit is contained in:
@@ -17,6 +17,7 @@ const fetchCameraSideConfig = async ({ queryKey }: { queryKey: string[] }) => {
|
||||
const updateCamerasideConfig = async (data: {
|
||||
id: string | number;
|
||||
friendlyName: string;
|
||||
cameraAddress: string;
|
||||
}) => {
|
||||
const updateUrl = `${base_url}/update-config?id=${data.id}`;
|
||||
|
||||
@@ -24,16 +25,17 @@ const updateCamerasideConfig = async (data: {
|
||||
id: data.friendlyName,
|
||||
fields: [
|
||||
{
|
||||
property: "id",
|
||||
value: data.friendlyName,
|
||||
property: "propURI",
|
||||
value: data.cameraAddress,
|
||||
},
|
||||
],
|
||||
};
|
||||
console.log(updateConfigPayload);
|
||||
const response = await fetch(updateUrl, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(updateConfigPayload),
|
||||
});
|
||||
if (!response.ok) throw new Error("Cannot reach update camera endpoint");
|
||||
if (!response.ok) throw new Error("Feature unavailable: Coming soon");
|
||||
};
|
||||
|
||||
export const useFetchCameraConfig = (cameraSide: string) => {
|
||||
|
||||
Reference in New Issue
Block a user