🐛 Fix feed pagination

This commit is contained in:
LittleSheep 2025-03-13 21:12:47 +08:00
parent 32f2e3f1ed
commit 14335084a1

View File

@ -24,12 +24,13 @@ func GetFeed(c *fiber.Ctx, limit int, user *uint, cursor *time.Time) ([]FeedEntr
var feed []FeedEntry
interTx, err := UniversalPostFilter(c, database.C, UniversalPostFilterConfig{
TimeCursor: cursor,
})
interTx, err := UniversalPostFilter(c, database.C)
if err != nil {
return nil, fmt.Errorf("failed to prepare load interactive posts: %v", err)
}
if cursor != nil {
interTx = interTx.Where("published_at < ?", *cursor)
}
interPosts, err := ListPostForFeed(interTx, limit/2, user)
if err != nil {
return nil, fmt.Errorf("failed to load interactive posts: %v", err)