From 0679b993a4bd2e93471e15fef2e6008eca18cd90 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Mon, 8 May 2023 12:28:16 +1000 Subject: [PATCH] refactor: use of `getAllItems()` --- routes/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routes/index.tsx b/routes/index.tsx index fd324b7ad..31af2f824 100644 --- a/routes/index.tsx +++ b/routes/index.tsx @@ -21,7 +21,8 @@ interface HomePageData extends State { export const handler: Handlers = { async GET(_req, ctx) { - const items = (await getAllItems()).slice(0, 10); + /** @todo Add pagination functionality */ + const items = await getAllItems({ limit: 10 }); const users = await getUsersByIds(items.map((item) => item.userId)); const commentsCounts = await Promise.all( items.map((item) => getItemCommentsCount(item.id)),