From e4d2a625d938478f2cb1b5716ead9c97b7f48fae Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 7 Jul 2024 16:26:50 +0800 Subject: [PATCH] :bug: Fix some feed api issue --- pkg/internal/server/api/feed_api.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/pkg/internal/server/api/feed_api.go b/pkg/internal/server/api/feed_api.go index 1ea887a..dc3121c 100644 --- a/pkg/internal/server/api/feed_api.go +++ b/pkg/internal/server/api/feed_api.go @@ -100,20 +100,8 @@ func listFeed(c *fiber.Ctx) error { return feed[i].CreatedAt.After(feed[j].CreatedAt) }) - start := offset - end := start + take - if start > len(feed) { - return c.JSON(fiber.Map{ - "count": postCount + articleCount, - "data": []FeedRecord{}, - }) - } - if end > len(feed) { - end = len(feed) - } - return c.JSON(fiber.Map{ "count": postCount + articleCount, - "data": feed[start:end], + "data": feed, }) }