got to a good point with sighting modal, want to do cleanup

This commit is contained in:
2025-09-16 11:07:35 +01:00
parent c414342515
commit c506c395e6
25 changed files with 490 additions and 141 deletions

View File

@@ -1,5 +1,3 @@
// Used to fetch and load the configs for the camera side
import { useMutation, useQuery } from "@tanstack/react-query";
import { toast } from "sonner";
@@ -14,7 +12,7 @@ const fetchCameraSideConfig = async ({ queryKey }: { queryKey: string[] }) => {
};
const updateCamerasideConfig = async (data: {
id: string;
id: string | number;
friendlyName: string;
}) => {
const updateUrl = `${base_url}/update-config?id=${data.id}`;
@@ -48,6 +46,7 @@ export const useFetchCameraConfig = (cameraSide: string) => {
onSuccess: () => toast("Settings Successfully saved"),
});
console.log(fetchedConfigQuery.data);
return {
data: fetchedConfigQuery.data,
isPending: fetchedConfigQuery.isPending,

View File

@@ -5,8 +5,8 @@ const apiUrl = import.meta.env.VITE_BASEURL;
async function fetchSnapshot(cameraSide: string) {
const response = await fetch(
`http://100.116.253.81/Colour-preview`
// `${apiUrl}/${cameraSide}-preview`
// `http://100.116.253.81/Colour-preview`
`${apiUrl}/${cameraSide}-preview`
);
if (!response.ok) {
throw new Error("Cannot reach endpoint");