jhoang304 / jhoang304/Whelp

Feature: pagination and sorting for the restaurant list and reviews

Open
#42 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
2h 19m
Merged PRs (30d)
30

Description

## Summary
`GET /api/restaurants` and `GET /api/restaurants//reviews` return every row. `RestaurantList` renders all cards with a staggered animation of `index * 0.1s`, so 100 restaurants would take 10 seconds to finish appearing. The reviews list on the detail page has no ordering control (newest first only, `GetAllReviews/index.tsx:41-43`).

## Proposal
- API: `page` and `per_page` params (default 20, max 50) returning `{"items": [...], "page", "per_page", "total"}`; a `sort` param for reviews (newest, highest, lowest).
- UI: "Load more" or numbered pages on `/restaurants` and search; a sort dropdown on reviews; cap the stagger animation to the first row.
- Leave the profile page unpaginated for now (bounded per user) or reuse the same component.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing GET /api/restaurants and GET /api/restaurants//reviews, then read GetAllReviews/index.tsx:41-43 and the RestaurantList entry point. Define how pagination, review sorting, search, and the animation cap fit together before implementation. Done means both endpoints return the proposed metadata and controls work for restaurant lists and review ordering without the long staggered delay.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.