From fed0e71c830f68105d6dd471d2a3d704338aa584 Mon Sep 17 00:00:00 2001 From: Fantasy lee <129943055+Fantasylee21@users.noreply.github.com> Date: Sat, 3 May 2025 18:15:17 +0800 Subject: [PATCH] =?UTF-8?q?[fix]:=20=E6=9B=B4=E6=94=B9=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=85=A8=E4=B8=BA=E7=A9=BA=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/curd/articleDB.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/curd/articleDB.py b/app/curd/articleDB.py index 9080ec0..10ad694 100644 --- a/app/curd/articleDB.py +++ b/app/curd/articleDB.py @@ -32,8 +32,9 @@ async def get_article_in_db(db: AsyncSession, get_article: GetArticle): ) articles = result.scalars().all() else: - articles = [] - total_count = 0 + result = await db.execute(select(ArticleDB)) + articles = result.scalars().all() + total_count = len(articles) return [GetResponse.model_validate(article) for article in articles], total_count