Skip to content

Conversation

@AhmedAlian7
Copy link
Contributor

Description

This PR introduces consistent pagination support across three list-based API endpoints: agencies-with-coverage, routes-for-agency, and vehicles-for-agency. This ensures better scalability when handling large datasets.

closes #338

Changes

  • Added ParsePaginationParams: A utility to extract offset (default 0) and limit (default 100, max 1000).
  • Added PaginateSlice: A generic helper to safely slice result lists.
  • Updated Handlers: Applied pagination logic to the following handlers using the new helpers.
  • Added Tests: Comprehensive unit tests for parameter parsing and boundary conditions.

Endpoints Modified

  • GET /api/where/agencies-with-coverage.json
  • GET /api/where/routes-for-agency/{id}.json
  • GET /api/where/vehicles-for-agency/{id}.json

@AhmedAlian7 AhmedAlian7 force-pushed the feat/consistent-pagination branch 2 times, most recently from 61d3dd9 to 89f544c Compare February 9, 2026 14:50
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.

Feature: Implement Pagination for List Endpoints

1 participant