Refactor pagination logic in ListPosts to enhance readability and maintainability
All checks were successful
CI - Build and Push / Build and Push Docker Image (push) Successful in 53s

This commit is contained in:
2025-10-25 14:04:14 +08:00
parent aaa89bf8b7
commit 7c994e6fba

View File

@@ -62,7 +62,7 @@ func (l *ListPostsLogic) ListPosts(req *types.ListPostsReq) (resp *types.ListPos
} }
defer rows.Close() defer rows.Close()
var posts []types.ListPostsRespPosts posts := []types.ListPostsRespPosts{}
for rows.Next() { for rows.Next() {
var post types.ListPostsRespPosts var post types.ListPostsRespPosts
var coverID sql.NullInt64 var coverID sql.NullInt64