From b5602cbf44b48fea664a2e4e82ea9c989f804afc Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Wed, 3 Sep 2025 18:03:03 +0900 Subject: [PATCH] =?UTF-8?q?Debug:=20=EC=84=9C=EC=A0=81=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=B2=84=ED=8A=BC=20=EB=94=94=EB=B2=84=EA=B9=85=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - openBookEditor() 함수에 상세 디버깅 로그 추가 - URL 파라미터 파싱 과정 로그 추가 - bookId 값과 타입 확인 로그 추가 - 버튼 클릭 이벤트 확인을 위한 로그 추가 --- frontend/static/js/book-documents.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/frontend/static/js/book-documents.js b/frontend/static/js/book-documents.js index 4617954..847a3c6 100644 --- a/frontend/static/js/book-documents.js +++ b/frontend/static/js/book-documents.js @@ -38,6 +38,9 @@ window.bookDocumentsApp = () => ({ this.bookId = urlParams.get('book_id') || urlParams.get('bookId'); // 둘 다 지원 console.log('📖 서적 ID:', this.bookId); console.log('🔍 전체 URL 파라미터:', window.location.search); + console.log('🔍 URLSearchParams 객체:', urlParams); + console.log('🔍 book_id 파라미터:', urlParams.get('book_id')); + console.log('🔍 bookId 파라미터:', urlParams.get('bookId')); }, // 인증 상태 확인 @@ -166,11 +169,23 @@ window.bookDocumentsApp = () => ({ // 서적 편집 페이지 열기 openBookEditor() { + console.log('🔧 서적 편집 버튼 클릭됨'); + console.log('📖 현재 bookId:', this.bookId); + console.log('🔍 bookId 타입:', typeof this.bookId); + if (this.bookId === 'none') { alert('서적 미분류 문서들은 편집할 수 없습니다.'); return; } - window.location.href = `book-editor.html?bookId=${this.bookId}`; + + if (!this.bookId) { + alert('서적 ID가 없습니다. 페이지를 새로고침해주세요.'); + return; + } + + const targetUrl = `book-editor.html?bookId=${this.bookId}`; + console.log('🔗 이동할 URL:', targetUrl); + window.location.href = targetUrl; }, // 문서 수정