diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-17 14:06:08 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-17 14:06:08 +0900 |
| commit | 85d32a79dcf0f7047406039363baa2e06b859ddd (patch) | |
| tree | f6f25c1813145f9e7a7fcee6fdea33a2e37e70d6 /lib/swp/document-service.ts | |
| parent | 43ea8981b7667e9f35824bf36cc15b91efc8b4ad (diff) | |
(김준회) swp: 파일개수는 최신 rev에 대해서만 보이도록 수정, upload validation dialog의 content overflow 문제 수정(스타일) - 박진석 프로 요청
Diffstat (limited to 'lib/swp/document-service.ts')
| -rw-r--r-- | lib/swp/document-service.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/swp/document-service.ts b/lib/swp/document-service.ts index f83488d9..32126676 100644 --- a/lib/swp/document-service.ts +++ b/lib/swp/document-service.ts @@ -200,14 +200,17 @@ export async function getDocumentList( // 문서에 파일 통계 추가 const result = documents.map((doc) => { - const files = filesByDoc.get(doc.DOC_NO) || []; - const standbyFiles = files.filter((f) => f.STAT === "SCW01"); + const allFiles = filesByDoc.get(doc.DOC_NO) || []; + + // 최신 REV의 파일만 필터링 + const latestRevFiles = allFiles.filter((f) => f.REV_NO === doc.LTST_REV_NO); + const standbyFiles = latestRevFiles.filter((f) => f.STAT === "SCW01"); return { ...doc, - fileCount: files.length, + fileCount: latestRevFiles.length, standbyFileCount: standbyFiles.length, - latestFiles: files + latestFiles: latestRevFiles .sort((a, b) => b.CRTE_DTM.localeCompare(a.CRTE_DTM)) .slice(0, 5), // 최신 5개만 }; |
