diff --git a/frontend/static/js/book-editor.js b/frontend/static/js/book-editor.js index 8344806..45afce4 100644 --- a/frontend/static/js/book-editor.js +++ b/frontend/static/js/book-editor.js @@ -90,6 +90,13 @@ window.bookEditorApp = () => ({ console.log('๐Ÿ“„ ์„œ์  ๋ฌธ์„œ๋“ค:', this.documents.length, '๊ฐœ'); + // ๊ฐ ๋ฌธ์„œ์˜ PDF ๋งค์นญ ์ƒํƒœ ํ™•์ธ + this.documents.forEach((doc, index) => { + console.log(`๐Ÿ“„ ๋ฌธ์„œ ${index + 1}: ${doc.title}`); + console.log(` - matched_pdf_id: ${doc.matched_pdf_id || 'null'}`); + console.log(` - sort_order: ${doc.sort_order || 'null'}`); + }); + // ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ PDF ๋ฌธ์„œ๋“ค ๋กœ๋“œ (ํ˜„์žฌ ์„œ์ ์˜ PDF๋งŒ) console.log('๐Ÿ” ํ˜„์žฌ ์„œ์  ID:', this.bookId); console.log('๐Ÿ” ์ „์ฒด ๋ฌธ์„œ ์ˆ˜:', allDocuments.length); diff --git a/frontend/static/js/viewer/viewer-core.js b/frontend/static/js/viewer/viewer-core.js index 7fa700b..75088b3 100644 --- a/frontend/static/js/viewer/viewer-core.js +++ b/frontend/static/js/viewer/viewer-core.js @@ -1020,6 +1020,28 @@ window.documentViewer = () => ({ pdf_path: this.document.pdf_path }); + // ์บ์‹œ๋ฅผ ๋ฌด์‹œํ•˜๊ณ  ์ตœ์‹  ๋ฌธ์„œ ์ •๋ณด๋ฅผ ๋‹ค์‹œ ๊ฐ€์ ธ์˜ค๊ธฐ + console.log('๐Ÿ”„ ์ตœ์‹  ๋ฌธ์„œ ์ •๋ณด ์žฌ๋กœ๋“œ ์ค‘...'); + try { + const freshDocument = await this.api.getDocument(this.document.id); + console.log('๐Ÿ“„ ์ตœ์‹  ๋ฌธ์„œ ์ •๋ณด:', { + id: freshDocument.id, + matched_pdf_id: freshDocument.matched_pdf_id, + pdf_path: freshDocument.pdf_path + }); + + // ์ตœ์‹  ์ •๋ณด๋กœ ์—…๋ฐ์ดํŠธ + if (freshDocument.matched_pdf_id !== this.document.matched_pdf_id) { + console.log('๐Ÿ”„ PDF ๋งค์นญ ์ •๋ณด ์—…๋ฐ์ดํŠธ:', { + old: this.document.matched_pdf_id, + new: freshDocument.matched_pdf_id + }); + this.document.matched_pdf_id = freshDocument.matched_pdf_id; + } + } catch (error) { + console.error('โŒ ์ตœ์‹  ๋ฌธ์„œ ์ •๋ณด ๋กœ๋“œ ์‹คํŒจ:', error); + } + // 1. ํ˜„์žฌ ๋ฌธ์„œ ์ž์ฒด๊ฐ€ PDF์ธ ๊ฒฝ์šฐ if (this.document.pdf_path) { console.log('๐Ÿ“„ ํ˜„์žฌ ๋ฌธ์„œ๊ฐ€ PDF - ์ง์ ‘ ๋‹ค์šด๋กœ๋“œ');