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; }, // λ¬Έμ„œ μˆ˜μ •