diff --git a/frontend/issues-inbox.html b/frontend/issues-inbox.html index 31fdd4a..1c59a4a 100644 --- a/frontend/issues-inbox.html +++ b/frontend/issues-inbox.html @@ -224,6 +224,153 @@ + + + + + + + + + @@ -307,11 +454,19 @@ }); } - // 부적합 목록 로드 + // 수신함 부적합 목록 로드 (실제 API 연동) async function loadIssues() { showLoading(true); try { - const response = await fetch('/api/issues/', { + const projectId = document.getElementById('projectFilter').value; + let url = '/api/inbox/'; + + // 프로젝트 필터 적용 + if (projectId) { + url += `?project_id=${projectId}`; + } + + const response = await fetch(url, { headers: { 'Authorization': `Bearer ${localStorage.getItem('access_token')}`, 'Content-Type': 'application/json' @@ -322,19 +477,19 @@ issues = await response.json(); // 읽음 상태 로드 (localStorage에서) - const savedReadStatus = localStorage.getItem('issues_read_status'); + const savedReadStatus = localStorage.getItem('inbox_read_status'); if (savedReadStatus) { readStatus = new Set(JSON.parse(savedReadStatus)); } filterIssues(); - updateStatistics(); + await loadStatistics(); } else { - throw new Error('부적합 목록을 불러올 수 없습니다.'); + throw new Error('수신함 목록을 불러올 수 없습니다.'); } } catch (error) { - console.error('부적합 로드 실패:', error); - showError('부적합 목록을 불러오는데 실패했습니다.'); + console.error('수신함 로드 실패:', error); + showError('수신함 목록을 불러오는데 실패했습니다.'); } finally { showLoading(false); } @@ -414,29 +569,45 @@ const timeAgo = getTimeAgo(new Date(issue.created_at)); return ` -
+
${isUnread ? '
' : '
'} - ${getStatusText(issue.status)} + 검토 대기 ${project ? `${project.name}` : ''} ${timeAgo}
-

${issue.description}

+

${issue.description}

-
+
${issue.reporter?.username || '알 수 없음'} ${createdDate} ${issue.category ? `${getCategoryText(issue.category)}` : ''} + ${issue.photo_path ? '사진 첨부' : ''} +
+ + +
+ + +
- ${issue.photo_path ? '' : ''} -