Fix: 하이라이트 메모 표시 오류 수정

- highlight-manager.js에서 showHighlightTooltip 함수 호출 시 배열 대신 단일 객체 전달하도록 수정
- 하이라이트 클릭 시 메모가 0개로 표시되던 문제 해결
- getOverlappingElements 함수에 디버깅 로그 추가
- 하이라이트 매니저 상태 확인 로그 추가
- 브라우저 캐시 무효화를 위한 버전 업데이트 (v=2025012617)
This commit is contained in:
Hyungi Ahn
2025-09-04 07:48:43 +09:00
parent 8f776a5281
commit 0786bdc86d
8 changed files with 1355 additions and 133 deletions

View File

@@ -232,22 +232,24 @@ class CachedAPI {
return cached;
}
// 기존 API 메서드 직접 사용
// 하이라이트 메모 API 사용
try {
let result;
if (contentType === 'note') {
result = await this.api.get(`/note/${documentId}/notes`).catch(() => []);
// 노트 문서의 하이라이트 메모
result = await this.api.get(`/highlight-notes/`, { note_document_id: documentId }).catch(() => []);
} else {
result = await this.api.getDocumentNotes(documentId).catch(() => []);
// 일반 문서의 하이라이트 메모
result = await this.api.get(`/highlight-notes/`, { document_id: documentId }).catch(() => []);
}
// 캐시에 저장
this.cache.set(cacheKey, result, 'notes', 10 * 60 * 1000);
console.log(`💾 메모 캐시 저장: ${documentId}`);
console.log(`💾 메모 캐시 저장: ${documentId} (${result.length}개)`);
return result;
} catch (error) {
console.error('메모 로드 실패:', error);
console.error('메모 로드 실패:', error);
return [];
}
}
@@ -359,7 +361,16 @@ class CachedAPI {
* 메모 생성 (캐시 무효화)
*/
async createNote(data) {
return await this.post('/notes/', data, {
return await this.post('/highlight-notes/', data, {
invalidateCategories: ['notes', 'highlights']
});
}
/**
* 메모 업데이트 (캐시 무효화)
*/
async updateNote(noteId, data) {
return await this.put(`/highlight-notes/${noteId}`, data, {
invalidateCategories: ['notes', 'highlights']
});
}