Debug: 서적 수정 버튼 디버깅 로그 추가

- openBookEditor() 함수에 상세 디버깅 로그 추가
- URL 파라미터 파싱 과정 로그 추가
- bookId 값과 타입 확인 로그 추가
- 버튼 클릭 이벤트 확인을 위한 로그 추가
This commit is contained in:
Hyungi Ahn
2025-09-03 18:03:03 +09:00
parent 0833b99e6f
commit b5602cbf44

View File

@@ -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;
},
// 문서 수정