use base path when fetching go2rtc data

This commit is contained in:
Josh Hawkins 2025-11-26 13:55:11 -06:00
parent 376e5b5c25
commit 70e5ce5771
2 changed files with 14 additions and 6 deletions

View File

@ -1,3 +1,4 @@
import { baseUrl } from "@/api/baseUrl";
import { CameraConfig, FrigateConfig } from "@/types/frigateConfig";
import { useCallback, useEffect, useState, useMemo } from "react";
import useSWR from "swr";
@ -41,9 +42,12 @@ export default function useCameraLiveMode(
const metadataPromises = streamNames.map(async (streamName) => {
try {
const response = await fetch(`/api/go2rtc/streams/${streamName}`, {
priority: "low",
});
const response = await fetch(
`${baseUrl}api/go2rtc/streams/${streamName}`,
{
priority: "low",
},
);
if (response.ok) {
const data = await response.json();

View File

@ -1,3 +1,4 @@
import { baseUrl } from "@/api/baseUrl";
import { generateFixedHash, isValidId } from "./stringUtil";
/**
@ -52,9 +53,12 @@ export async function detectReolinkCamera(
password,
});
const response = await fetch(`/api/reolink/detect?${params.toString()}`, {
method: "GET",
});
const response = await fetch(
`${baseUrl}api/reolink/detect?${params.toString()}`,
{
method: "GET",
},
);
if (!response.ok) {
return null;