From b1bad804265fb3332b43b6a1f45ade2c912082d4 Mon Sep 17 00:00:00 2001 From: Arthur Lefebvre Date: Fri, 3 Apr 2026 15:47:54 +0200 Subject: [PATCH] Collections: sort by latest collections first --- internal/query/query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/query/query.go b/internal/query/query.go index f0a4a32..c154e75 100644 --- a/internal/query/query.go +++ b/internal/query/query.go @@ -199,7 +199,7 @@ type collectionId struct { func FetchAllCollections(db *gorm.DB, userId uint, limit int, offset int) ([]CollectionsQueryResult, error) { var collections []CollectionsQueryResult var collectionIds []collectionId - res := fetchCollections(db, userId).Limit(limit).Offset(offset).Find(&collectionIds) + res := fetchCollections(db, userId).Limit(limit).Offset(offset).Order("collections.id DESC").Find(&collectionIds) if res.Error != nil { return collections, res.Error }