- more addition bugfixes
This commit is contained in:
@@ -20,13 +20,13 @@ async function zoomIn(options: ZoomInOptions) {
|
||||
|
||||
async function fetchZoomInConfig({ queryKey }: QueryFunctionContext<[string, zoomConfig]>) {
|
||||
const [, { camera }] = queryKey;
|
||||
const response = await fetch(`${CAM_BASE}/Ip${camera}-command`, {
|
||||
const response = await fetch(`${CAM_BASE}/api/fetch-config?id=Ip${camera}`, {
|
||||
signal: AbortSignal.timeout(500),
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error("Cannot get camera zoom settings");
|
||||
}
|
||||
return response.text();
|
||||
return response.json();
|
||||
}
|
||||
//change to string
|
||||
export const useCameraZoom = (options: zoomConfig) => {
|
||||
@@ -46,7 +46,7 @@ export const useCameraZoom = (options: zoomConfig) => {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (query.isError) toast.error(query.error.message, { id: "hardReboot" });
|
||||
if (query.isError) toast.error(query.error.message, { id: "zoom" });
|
||||
}, [query?.error?.message, query.isError]);
|
||||
|
||||
return { mutation, query };
|
||||
|
||||
Reference in New Issue
Block a user