From 5a19cde38c4820b688b8ad50155c505411c511a6 Mon Sep 17 00:00:00 2001 From: hyungi Date: Mon, 8 Jun 2026 09:57:47 +0900 Subject: [PATCH] =?UTF-8?q?fix(documents):=20=EB=8F=84=EB=A9=94=EC=9D=B8?= =?UTF-8?q?=20=ED=8A=B8=EB=A6=AC=20=EC=B9=B4=EC=9A=B4=ED=8A=B8=EB=A5=BC=20?= =?UTF-8?q?=EB=AC=B8=EC=84=9C=ED=95=A8=20list=20=EC=A0=9C=EC=99=B8?= =?UTF-8?q?=EC=99=80=20=EC=9D=BC=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 트리(/documents/tree)는 deleted 만 제외하고 뉴스/법령/메모를 다 세는데, 문서함 list 는 source_channel news/law_monitor + file_type note 를 기본 제외 → '트리는 N건인데 클릭하면 0건' 불일치(예: Philosophy/Aesthetics 5건 전부 news+note 라 클릭 시 0). 트리 쿼리에 동일 제외 적용해 카운트=실제 표시 일치. 영향: Philosophy 12→2, General 189→84 등 정상화. Co-Authored-By: Claude Opus 4.8 (1M context) --- app/api/documents.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/api/documents.py b/app/api/documents.py index 724eac6..74e8c55 100644 --- a/app/api/documents.py +++ b/app/api/documents.py @@ -192,6 +192,11 @@ async def get_document_tree( FROM documents WHERE ai_domain IS NOT NULL AND ai_domain != '' AND ai_domain != 'News' AND deleted_at IS NULL + -- 문서함(list) 기본 제외와 동일하게 맞춤: 뉴스/법령 채널·메모는 문서함에 안 뜨므로 + -- 트리 카운트도 제외해야 "트리 N건인데 클릭하면 0건" 불일치가 안 생긴다. + AND source_channel != 'news' + AND source_channel != 'law_monitor' + AND file_type != 'note' GROUP BY ai_domain ORDER BY ai_domain """)