From b090ff8f29f82a2ab2287c7f7cd4f49e976609ab Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Sun, 26 Oct 2025 12:44:21 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B4=80=EB=A6=AC=ED=95=A8=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=EB=82=B4=EC=9A=A9=20=ED=8E=B8=EC=A7=91=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20JavaScript=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ› ํ•ด๊ฒฐ๋œ ์˜ค๋ฅ˜๋“ค: 1๏ธโƒฃ ReferenceError: allIssues ๋ณ€์ˆ˜ ์ฐธ์กฐ ์˜ค๋ฅ˜: - allIssues โ†’ issues๋กœ ๋ณ€์ˆ˜๋ช… ์ˆ˜์ • - ๊ด€๋ฆฌํ•จ ํŽ˜์ด์ง€์—์„œ ์‚ฌ์šฉํ•˜๋Š” ์˜ฌ๋ฐ”๋ฅธ ๋ณ€์ˆ˜๋ช… ์ ์šฉ - cancelDetailEdit(), saveDetailEdit() ํ•จ์ˆ˜์—์„œ ์ˆ˜์ • 2๏ธโƒฃ TypeError: additionalInfoForm ์š”์†Œ ์ฐธ์กฐ ์˜ค๋ฅ˜: - document.getElementById() ๊ฒฐ๊ณผ null ์ฒดํฌ ์ถ”๊ฐ€ - ์š”์†Œ๊ฐ€ ์กด์žฌํ•  ๋•Œ๋งŒ ์ด๋ฒคํŠธ ๋ฆฌ์Šค๋„ˆ ๋“ฑ๋ก - ์•ˆ์ „ํ•œ DOM ์š”์†Œ ์ ‘๊ทผ์œผ๋กœ ๊ฐœ์„  ๐Ÿ”ง ์ฝ”๋“œ ์•ˆ์ •์„ฑ ๊ฐœ์„ : - DOM ์š”์†Œ ์กด์žฌ ์—ฌ๋ถ€ ํ™•์ธ ํ›„ ์ ‘๊ทผ - ๋ณ€์ˆ˜ ์Šค์ฝ”ํ”„ ์ผ๊ด€์„ฑ ์œ ์ง€ - ์˜ค๋ฅ˜ ๋ฐฉ์ง€๋ฅผ ์œ„ํ•œ ๋ฐฉ์–ด์  ํ”„๋กœ๊ทธ๋ž˜๋ฐ ๐Ÿ’ก ์ˆ˜์ • ์‚ฌํ•ญ: - issues.find() ์‚ฌ์šฉ์œผ๋กœ ์˜ฌ๋ฐ”๋ฅธ ๋ฐ์ดํ„ฐ ์ ‘๊ทผ - if (additionalInfoForm) ์กฐ๊ฑด๋ถ€ ์ด๋ฒคํŠธ ๋ฆฌ์Šค๋„ˆ ๋“ฑ๋ก - ์ค‘๊ด„ํ˜ธ ๋ˆ„๋ฝ ๋ฌธ์ œ ํ•ด๊ฒฐ Expected Result: โœ… ์ƒ์„ธ ๋‚ด์šฉ ํŽธ์ง‘ ๊ธฐ๋Šฅ ์ •์ƒ ์ž‘๋™ โœ… JavaScript ์˜ค๋ฅ˜ ์—†๋Š” ์•ˆ์ •์ ์ธ ์‹คํ–‰ โœ… DOM ์š”์†Œ ์•ˆ์ „ ์ ‘๊ทผ โœ… ์ผ๊ด€๋œ ๋ณ€์ˆ˜ ์ฐธ์กฐ --- frontend/issues-management.html | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/issues-management.html b/frontend/issues-management.html index b2f0631..b76104b 100644 --- a/frontend/issues-management.html +++ b/frontend/issues-management.html @@ -1502,8 +1502,10 @@ } } - // ์ถ”๊ฐ€ ์ •๋ณด ํผ ์ œ์ถœ ์ฒ˜๋ฆฌ - document.getElementById('additionalInfoForm').addEventListener('submit', async function(e) { + // ์ถ”๊ฐ€ ์ •๋ณด ํผ ์ œ์ถœ ์ฒ˜๋ฆฌ (์š”์†Œ๊ฐ€ ์กด์žฌํ•  ๋•Œ๋งŒ) + const additionalInfoForm = document.getElementById('additionalInfoForm'); + if (additionalInfoForm) { + additionalInfoForm.addEventListener('submit', async function(e) { e.preventDefault(); if (!selectedIssueId) { @@ -1542,7 +1544,8 @@ console.error('์ถ”๊ฐ€ ์ •๋ณด ์ €์žฅ ์‹คํŒจ:', error); alert('์ €์žฅ ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.'); } - }); + }); + } // ์ƒ์„ธ ๋‚ด์šฉ ํŽธ์ง‘ ๊ด€๋ จ ํ•จ์ˆ˜๋“ค function toggleDetailEdit(issueId) { @@ -1570,7 +1573,7 @@ editDiv.classList.add('hidden'); // ์›๋ž˜ ๊ฐ’์œผ๋กœ ๋ณต์› - const issue = allIssues.find(i => i.id === issueId); + const issue = issues.find(i => i.id === issueId); if (issue) { const textarea = document.getElementById(`detail-textarea-${issueId}`); if (textarea) { @@ -1588,7 +1591,7 @@ try { // ํ˜„์žฌ ์ด์Šˆ ์ •๋ณด ๊ฐ€์ ธ์˜ค๊ธฐ - const issue = allIssues.find(i => i.id === issueId); + const issue = issues.find(i => i.id === issueId); if (!issue) { alert('์ด์Šˆ ์ •๋ณด๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.'); return;