Collections: sort by latest collections first
This commit is contained in:
@@ -199,7 +199,7 @@ type collectionId struct {
|
|||||||
func FetchAllCollections(db *gorm.DB, userId uint, limit int, offset int) ([]CollectionsQueryResult, error) {
|
func FetchAllCollections(db *gorm.DB, userId uint, limit int, offset int) ([]CollectionsQueryResult, error) {
|
||||||
var collections []CollectionsQueryResult
|
var collections []CollectionsQueryResult
|
||||||
var collectionIds []collectionId
|
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 {
|
if res.Error != nil {
|
||||||
return collections, res.Error
|
return collections, res.Error
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user