Skip to content

Commit

Permalink
Merge pull request #164 from denoland/refactor-use-of-getAllItems
Browse files Browse the repository at this point in the history
refactor: use of `getAllItems()`
  • Loading branch information
iuioiua authored May 8, 2023
2 parents 611716d + 0679b99 commit aed3b0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ interface HomePageData extends State {

export const handler: Handlers<HomePageData, State> = {
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)),
Expand Down

0 comments on commit aed3b0d

Please sign in to comment.