From a9577a8f9a28b22537ef4002c9d208ab7352e15a Mon Sep 17 00:00:00 2001 From: SeongHyun Kim Date: Wed, 26 Nov 2025 18:24:15 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=88=98=EC=A3=BC=20=EB=93=B1=EB=A1=9D?= =?UTF-8?q?=20=EC=8B=9C=20=EC=82=AC=EC=9A=A9=EC=9E=90=EA=B0=80=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=ED=95=9C=20=EC=88=98=EC=A3=BC=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EB=8D=AE=EC=96=B4=EC=93=B0=EA=B8=B0=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 저장 시점에 채번 규칙 강제 재할당 로직 제거 - TextInputComponent에서 생성된 값을 사용자가 수정하면 그대로 유지 - allocateNumberingCode API 불필요한 호출 제거 - 사용자 입력 값 보존 및 순번 불필요 증가 방지 --- frontend/lib/utils/buttonActions.ts | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/frontend/lib/utils/buttonActions.ts b/frontend/lib/utils/buttonActions.ts index eafbd814..3dcdf6a0 100644 --- a/frontend/lib/utils/buttonActions.ts +++ b/frontend/lib/utils/buttonActions.ts @@ -392,27 +392,12 @@ export class ButtonActionExecutor { // console.log("📋 채번 규칙이 설정된 필드:", fieldsWithNumbering); // console.log("📊 필드 개수:", Object.keys(fieldsWithNumbering).length); - // 각 필드에 대해 실제 코드 할당 - for (const [fieldName, ruleId] of Object.entries(fieldsWithNumbering)) { - try { - // console.log(`🎫 ${fieldName} 필드에 채번 규칙 ${ruleId} 할당 시작`); - const { allocateNumberingCode } = await import("@/lib/api/numberingRule"); - const response = await allocateNumberingCode(ruleId); - - // console.log(`📡 API 응답 (${fieldName}):`, response); - - if (response.success && response.data) { - const generatedCode = response.data.generatedCode; - formData[fieldName] = generatedCode; - // console.log(`✅ ${fieldName} = ${generatedCode} (할당 완료)`); - } else { - console.error(`❌ 채번 규칙 할당 실패 (${fieldName}):`, response.error); - toast.error(`${fieldName} 채번 규칙 할당 실패: ${response.error}`); - } - } catch (error) { - console.error(`❌ 채번 규칙 할당 오류 (${fieldName}):`, error); - toast.error(`${fieldName} 채번 규칙 할당 오류`); - } + // 사용자 입력 값 유지 (재할당하지 않음) + // 채번 규칙은 TextInputComponent 마운트 시 이미 생성되었으므로 + // 저장 시점에는 사용자가 수정한 값을 그대로 사용 + if (Object.keys(fieldsWithNumbering).length > 0) { + console.log("ℹ️ 채번 규칙 필드 감지:", Object.keys(fieldsWithNumbering)); + console.log("ℹ️ 사용자 입력 값 유지 (재할당 하지 않음)"); } // console.log("✅ 채번 규칙 할당 완료");