- Improved development environment
This commit is contained in:
@@ -4,8 +4,10 @@ import type { CameraBlackBoardOptions } from "../types/types";
|
||||
import { useEffect } from "react";
|
||||
import { toast } from "sonner";
|
||||
|
||||
const camBase = import.meta.env.MODE !== "development" ? CAM_BASE : "";
|
||||
|
||||
const getAllBlackboardData = async () => {
|
||||
const response = await fetch(`${CAM_BASE}/api/blackboard`, {
|
||||
const response = await fetch(`${camBase}/api/blackboard`, {
|
||||
signal: AbortSignal.timeout(500),
|
||||
});
|
||||
if (!response.ok) {
|
||||
@@ -15,7 +17,7 @@ const getAllBlackboardData = async () => {
|
||||
};
|
||||
|
||||
const viewBlackboardData = async (options: CameraBlackBoardOptions) => {
|
||||
const response = await fetch(`${CAM_BASE}/api/blackboard`, {
|
||||
const response = await fetch(`/${camBase}api/blackboard`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(options),
|
||||
|
||||
Reference in New Issue
Block a user