Skip to content

Bugfix pagination not handled - #126

Merged
sergiosja merged 2 commits into
mainfrom
bugfix-pagination-not-handled
Mar 18, 2026
Merged

Bugfix pagination not handled#126
sergiosja merged 2 commits into
mainfrom
bugfix-pagination-not-handled

Conversation

@stianjsu

Copy link
Copy Markdown
Collaborator

Fixes pagination handling across all CRUD endpoints. The @bp.paginate() decorator silently enforced a default page size of 10, which meant newly created events (and other entities) wouldn't show up in the frontend unless they fell within the first page. Removed the decorator entirely in favor of direct service calls with optional pagination parameters.

Key additions

  • Removed @bp.paginate() decorator from events, groups, restaurants, and slack_users CRUD endpoints — the decorator wasn't compatible with how responses were being returned
  • Made page and per_page optional (defaulting to None) in EventService, GroupService, and RestaurantService so endpoints work without pagination parameters
  • Added default ordering by event_time descending in EventRepository so events come back in a sensible order without relying on the paginator
  • Added TESTING.md documenting current test coverage, known gaps, and recommendations
  • Updated Dockerfile.backend with PostgreSQL client tools and added run-tests.sh for running tests inside Docker

How Has This Been Tested?

  • Updated service tests (test_event_service, test_group_service, test_restaurant_service, test_slack_user_service) to match the new optional pagination signatures

Comment thread application/backend/app/repositories/event_repository.py
Comment thread application/backend/TESTING.md
Comment thread application/containers/development/Dockerfile.backend
@sergiosja
sergiosja merged commit c898d6f into main Mar 18, 2026
1 check passed
@sergiosja
sergiosja deleted the bugfix-pagination-not-handled branch March 18, 2026 19:43
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.

2 participants