Skip to content

perf(expenses,study): add skip/limit pagination to list endpoints#70

Merged
TemaDeveloper merged 1 commit into
TemaDeveloper:mainfrom
Chzhqv:fix/expenses-study-pagination
Jul 7, 2026
Merged

perf(expenses,study): add skip/limit pagination to list endpoints#70
TemaDeveloper merged 1 commit into
TemaDeveloper:mainfrom
Chzhqv:fix/expenses-study-pagination

Conversation

@Chzhqv

@Chzhqv Chzhqv commented Jul 7, 2026

Copy link
Copy Markdown

Summary

  • /api/expenses and /api/study/sessions hard-capped results at 200 with no way to page past that, so users with more data could never see older entries.
  • Accept optional limit (clamped 1-200, default 200 to preserve prior behavior) and skip query params, and return a total count alongside the page.

Test plan

  • Seeded 15 real expenses via the API, paged through all 3 pages of 5 — no overlaps or duplicates, correct sort order, correct total
  • Confirmed backward compatibility: no params behaves identically to the old hardcoded-200 behavior
  • Confirmed clamping (limit=99999 → 200) and safe fallback on invalid input (limit=abc) — no crash
  • Repeated a lighter version of the same test for study/sessions
  • pnpm lint, tsc --noEmit, full vitest run (556/556) all pass

Fixes #13

Both routes hard-capped results at 200 with no way to page past that,
so users with more than 200 expenses or study sessions could never
see older entries. Accept optional limit (clamped 1-200, default 200
to preserve prior behavior) and skip query params, and return total
count alongside the page so callers can tell if more data exists.

Fixes TemaDeveloper#13
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Artemii's projects Team on Vercel.

A member of the Team first needs to authorize it.

@TemaDeveloper TemaDeveloper left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@TemaDeveloper TemaDeveloper merged commit 4ea3a11 into TemaDeveloper:main Jul 7, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: No pagination on large result sets

2 participants