added sounds, updated nped config and tweaks + code quality improvements
This commit is contained in:
@@ -2,10 +2,10 @@ import { useMutation, useQuery } from "@tanstack/react-query";
|
||||
import type { NPEDFieldType } from "../types/types";
|
||||
import { useNPEDContext } from "../context/NPEDUserContext";
|
||||
import { useEffect } from "react";
|
||||
import { CAM_BASE } from "../utils/config";
|
||||
|
||||
const base_url = import.meta.env.VITE_OUTSIDE_BASEURL;
|
||||
async function fetchNPEDDetails() {
|
||||
const fetchUrl = `${base_url}/fetch-config?id=NPED`;
|
||||
const fetchUrl = `${CAM_BASE}/api/fetch-config?id=NPED`;
|
||||
const response = await fetch(fetchUrl);
|
||||
if (!response.ok) throw new Error("Cannot reach fetch-config endpoint");
|
||||
|
||||
@@ -14,8 +14,8 @@ async function fetchNPEDDetails() {
|
||||
|
||||
async function signIn(loginDetails: NPEDFieldType) {
|
||||
const { frontId, rearId, username, password, clientId } = loginDetails;
|
||||
const NPEDLoginURLFront = `${base_url}/update-config?id=${frontId}`;
|
||||
const NPEDLoginURLRear = `${base_url}/update-config?id=${rearId}`;
|
||||
const NPEDLoginURLFront = `${CAM_BASE}/api/update-config?id=${frontId}`;
|
||||
const NPEDLoginURLRear = `${CAM_BASE}/api/update-config?id=${rearId}`;
|
||||
const frontCameraPayload = {
|
||||
id: frontId,
|
||||
fields: [
|
||||
@@ -66,7 +66,7 @@ async function signOut() {
|
||||
{ property: "propClientID", value: "" },
|
||||
],
|
||||
};
|
||||
const NPEDLoginURLFront = `${base_url}/update-config?id=NPED`;
|
||||
const NPEDLoginURLFront = `${CAM_BASE}/api/update-config?id=NPED`;
|
||||
const response = await fetch(NPEDLoginURLFront, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(nullPayload),
|
||||
|
||||
Reference in New Issue
Block a user