got to a good point with sighting modal, want to do cleanup
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user