Skip to content

Commit fed0e71

Browse files
committed
[fix]: 更改参数全为空情况
1 parent 78644d7 commit fed0e71

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/curd/articleDB.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ async def get_article_in_db(db: AsyncSession, get_article: GetArticle):
3232
)
3333
articles = result.scalars().all()
3434
else:
35-
articles = []
36-
total_count = 0
35+
result = await db.execute(select(ArticleDB))
36+
articles = result.scalars().all()
37+
total_count = len(articles)
3738

3839
return [GetResponse.model_validate(article) for article in articles], total_count
3940

0 commit comments

Comments
 (0)