From 5a370de52d6947d35aa07f9545c4f6a4d83eadd7 Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Wed, 26 Nov 2025 18:43:10 +0900
Subject: (김준회) dolce 메모리 효율적 동기화 처리(Streaming), 로컬 건 Date
 정보 formatting, Uploader 정보 네임 표시
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../add-and-modify-detail-drawing-dialog-v2.tsx    | 131 +--------------------
 1 file changed, 2 insertions(+), 129 deletions(-)

(limited to 'lib/dolce-v2/dialogs/add-and-modify-detail-drawing-dialog-v2.tsx')

diff --git a/lib/dolce-v2/dialogs/add-and-modify-detail-drawing-dialog-v2.tsx b/lib/dolce-v2/dialogs/add-and-modify-detail-drawing-dialog-v2.tsx
index b8650b1a..7577d133 100644
--- a/lib/dolce-v2/dialogs/add-and-modify-detail-drawing-dialog-v2.tsx
+++ b/lib/dolce-v2/dialogs/add-and-modify-detail-drawing-dialog-v2.tsx
@@ -319,135 +319,8 @@ export function AddAndModifyDetailDrawingDialogV2({
   };
 
   const handleCancel = () => {
-    // 유효성 검사
-    if (!registerKind) {
-      toast.error(t("addDetailDialog.selectRegisterKindError"));
-      return;
-    }
-    
-    if (drawingUsage !== "CMT") {
-      if (!revision.trim()) {
-        toast.error(t("addDetailDialog.selectRevisionError"));
-        setRevisionError(t("addDetailDialog.revisionRequired"));
-        return;
-      }
-      
-      // Revision 형식 검증
-      const revisionValidationError = validateRevision(revision);
-      if (revisionValidationError) {
-        toast.error(revisionValidationError);
-        setRevisionError(revisionValidationError);
-        return;
-      }
-    }
-    
-    // Add 모드일 때만 파일 필수
-    if (mode === "add") {
-      if (!drawing) return;
-      if (!drawingUsage) {
-        toast.error(t("addDetailDialog.selectDrawingUsageError"));
-        return;
-      }
-      if (files.length === 0) {
-        toast.error(t("addDetailDialog.selectFilesError"));
-        return;
-      }
-    }
-
-    // Edit 모드일 때는 detailDrawing 필수
-    if (mode === "edit" && !detailDrawing) {
-      toast.error(t("editDetailDialog.editError"));
-      return;
-    }
-
-    try {
-      setIsSubmitting(true);
-
-      // FormData 구성
-      const formData = new FormData();
-      formData.append("userId", userId);
-      formData.append("userNm", userName);
-      formData.append("vendorCode", vendorCode);
-      formData.append("email", userEmail);
-
-      if (mode === "add" && drawing) {
-        const uploadId = uuidv4();
-        
-        const dwgList = [
-            {
-              Mode: "ADD",
-              Status: "Submitted",
-              RegisterId: 0,
-              ProjectNo: drawing.ProjectNo,
-              Discipline: drawing.Discipline,
-              DrawingKind: drawing.DrawingKind,
-              DrawingNo: drawing.DrawingNo,
-              DrawingName: drawing.DrawingName,
-              RegisterGroupId: drawing.RegisterGroupId,
-              RegisterSerialNo: 0,
-              RegisterKind: registerKind,
-              DrawingRevNo: drawingUsage === "CMT" ? null : revision,
-              Category: "TS",
-              Receiver: null,
-              Manager: "",
-              RegisterDesc: comment,
-              UploadId: uploadId,
-              RegCompanyCode: vendorCode,
-            },
-        ];
-        formData.append("dwgList", JSON.stringify(dwgList));
-        
-        // 파일 추가
-        formData.append("fileCount", String(files.length));
-        files.forEach((file, index) => {
-            formData.append(`file_${index}`, file);
-        });
-
-      } else if (mode === "edit" && detailDrawing) {
-         const dwgList = [
-            {
-              Mode: "MOD",
-              Status: detailDrawing.Status,
-              RegisterId: detailDrawing.RegisterId,
-              ProjectNo: detailDrawing.ProjectNo,
-              Discipline: detailDrawing.Discipline,
-              DrawingKind: detailDrawing.DrawingKind,
-              DrawingNo: detailDrawing.DrawingNo,
-              DrawingName: detailDrawing.DrawingName,
-              RegisterGroupId: detailDrawing.RegisterGroupId,
-              RegisterSerialNo: detailDrawing.RegisterSerialNo,
-              RegisterKind: registerKind,
-              DrawingRevNo: drawingUsage === "CMT" ? null : revision,
-              Category: detailDrawing.Category,
-              Receiver: detailDrawing.Receiver,
-              Manager: detailDrawing.Manager,
-              RegisterDesc: comment,
-              UploadId: detailDrawing.UploadId,
-              RegCompanyCode: detailDrawing.RegCompanyCode || vendorCode,
-            },
-        ];
-        formData.append("dwgList", JSON.stringify(dwgList));
-        formData.append("fileCount", "0"); // 수정 시에는 메타데이터만 수정 (파일 수정은 별도)
-      }
-
-      // Action 호출
-      const result = await editDetailDwgReceiptV2(formData);
-
-      if (result.success) {
-          toast.success(mode === "add" ? t("addDetailDialog.addSuccess") : t("editDetailDialog.editSuccess"));
-          resetForm();
-          onComplete();
-          onOpenChange(false);
-      } else {
-          throw new Error("Action failed");
-      }
-
-    } catch (error) {
-      console.error("상세도면 처리 실패:", error);
-      toast.error(mode === "add" ? t("addDetailDialog.addErrorMessage") : t("editDetailDialog.editErrorMessage"));
-    } finally {
-      setIsSubmitting(false);
-    }
+    resetForm();
+    onOpenChange(false);
   };
 
   // DrawingUsage가 변경되면 RegisterKind 초기화
-- 
cgit v1.2.3

