From 96b36c1db478fd34e419c955b9c70acd096ec663 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Mon, 22 Jul 2024 01:44:40 +0800 Subject: [PATCH] :sparkles: Sort based on published at --- pkg/internal/services/posts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/internal/services/posts.go b/pkg/internal/services/posts.go index ec7970a..52303fb 100644 --- a/pkg/internal/services/posts.go +++ b/pkg/internal/services/posts.go @@ -123,7 +123,7 @@ func ListPost(tx *gorm.DB, take int, offset int, noReact ...bool) ([]*models.Pos var items []*models.Post if err := tx. Limit(take).Offset(offset). - Order("created_at DESC"). + Order("published_at DESC"). Preload("Tags"). Preload("Categories"). Preload("Realm").