Add camera zoom functionality and refactor blackboard data fetching
- Introduced `useCameraZoom` hook for managing camera zoom operations. - Refactored `useCameraBlackboard` to improve data fetching function naming. - Updated `CameraSettingFields` to utilize new zoom functionality and handle zoom level changes. - Removed unnecessary console logs from `Dashboard`.
This commit is contained in:
@@ -2,7 +2,7 @@ import { useMutation, useQuery } from "@tanstack/react-query";
|
||||
import { CAM_BASE } from "../utils/config";
|
||||
import type { CameraBlackBoardOptions } from "../types/types";
|
||||
|
||||
const getBlackboardData = async () => {
|
||||
const getAllBlackboardData = async () => {
|
||||
const response = await fetch(`${CAM_BASE}/api/blackboard`);
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch blackboard data");
|
||||
@@ -25,7 +25,7 @@ const viewBlackboardData = async (options: CameraBlackBoardOptions) => {
|
||||
export const useCameraBlackboard = () => {
|
||||
const query = useQuery({
|
||||
queryKey: ["cameraBlackboard"],
|
||||
queryFn: getBlackboardData,
|
||||
queryFn: getAllBlackboardData,
|
||||
});
|
||||
|
||||
const mutation = useMutation({
|
||||
|
||||
Reference in New Issue
Block a user