From c3e22fae229f178c0d982d6951092d52f591240c Mon Sep 17 00:00:00 2001 From: Hossein Rahmani Date: Sat, 10 Feb 2024 09:55:19 +0330 Subject: [PATCH] Inspector operation changed --- components/InspectorOperations.tsx | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/components/InspectorOperations.tsx b/components/InspectorOperations.tsx index 016795b..56d8cf9 100644 --- a/components/InspectorOperations.tsx +++ b/components/InspectorOperations.tsx @@ -33,7 +33,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { OperateByInspector } from "@/utils/inspectorApi"; import { toast } from "sonner"; import { Decrypt, formatBytes } from "@/lib/utils"; -import { useState } from "react"; +import { useEffect, useRef, useState } from "react"; import { getOptions } from "@/utils/commonApi"; import AttachmentsDialog from "./AttachmentsDialog"; import { DialogTrigger } from "./ui/dialog"; @@ -53,6 +53,7 @@ export default function InspectorOperations({ key2: any; }) { const [file, setFile] = useState([]); + const [check, setCheck] = useState(false); // Queries const { data, isLoading, refetch } = useQuery({ @@ -275,15 +276,24 @@ export default function InspectorOperations({ { + console.log(field.value); + field.onChange(value); + setCheck(false); + }} // defaultValue={field.value} className="flex space-y-1 text-sm" > { + // @ts-expect-error + form.setValue("type", "private"); + }} value="private" className="ml-2 " + checked={form.getValues("type") == "private"} disabled={possibleOperations.length == 0} /> @@ -294,6 +304,7 @@ export default function InspectorOperations({ @@ -315,7 +326,15 @@ export default function InspectorOperations({ {/* Email */}