From 3631da295398d21bad50330e61d00d65d0d33f6c Mon Sep 17 00:00:00 2001 From: thug0bin Date: Sun, 8 Mar 2026 14:06:09 +0900 Subject: [PATCH] =?UTF-8?q?fix(products):=20PC=20=EC=B4=AC=EC=98=81=20?= =?UTF-8?q?=EC=8B=9C=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20null=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - closeImageModal() 호출 전 imageData 로컬 변수에 저장 - closeImageModal()에서 capturedImageData = null 초기화로 인한 버그 --- backend/templates/admin_products.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/templates/admin_products.html b/backend/templates/admin_products.html index 7b1b1be..a177012 100644 --- a/backend/templates/admin_products.html +++ b/backend/templates/admin_products.html @@ -1884,13 +1884,15 @@ if (!capturedImageData) { alert('촬영된 이미지가 없습니다'); return; } const code = imgModalBarcode || imgModalDrugCode; const name = imgModalName; - closeImageModal(); + const drugCode = imgModalDrugCode; + const imageData = capturedImageData; // 먼저 저장! + closeImageModal(); // 이 후 capturedImageData = null 됨 showToast(`"${name}" 이미지 저장 중...`); try { const res = await fetch(`/api/admin/product-images/${code}/upload`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ image_data: capturedImageData, product_name: name, drug_code: imgModalDrugCode }) + body: JSON.stringify({ image_data: imageData, product_name: name, drug_code: drugCode }) }); const data = await res.json(); if (data.success) { showToast('✅ 이미지 저장 완료!', 'success'); searchProducts(); }