more enhancements to loading and error feedback
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
} from "@tanstack/react-query";
|
||||
import { CAM_BASE } from "../utils/config";
|
||||
import type { zoomConfig, ZoomInOptions } from "../types/types";
|
||||
import { toast } from "sonner";
|
||||
|
||||
async function zoomIn(options: ZoomInOptions) {
|
||||
const response = await fetch(
|
||||
@@ -37,6 +38,9 @@ export const useCameraZoom = (options: zoomConfig) => {
|
||||
const mutation = useMutation({
|
||||
mutationKey: ["zoomIn"],
|
||||
mutationFn: (options: ZoomInOptions) => zoomIn(options),
|
||||
onError: () => {
|
||||
toast.error("Failed to update zoom settings", { id: "zoom" });
|
||||
},
|
||||
});
|
||||
|
||||
const query = useQuery({
|
||||
|
||||
Reference in New Issue
Block a user