Skip to content

Commit aed3b0d

Browse files
authoredMay 8, 2023
Merge pull request #164 from denoland/refactor-use-of-getAllItems
refactor: use of `getAllItems()`
2 parents 611716d + 0679b99 commit aed3b0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎routes/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ interface HomePageData extends State {
2121

2222
export const handler: Handlers<HomePageData, State> = {
2323
async GET(_req, ctx) {
24-
const items = (await getAllItems()).slice(0, 10);
24+
/** @todo Add pagination functionality */
25+
const items = await getAllItems({ limit: 10 });
2526
const users = await getUsersByIds(items.map((item) => item.userId));
2627
const commentsCounts = await Promise.all(
2728
items.map((item) => getItemCommentsCount(item.id)),

0 commit comments

Comments
 (0)