Skip to content

Add member list pagination and search support to API

Anna Geiduschek requested to merge member-list-pagination into dev

This is change includes API support so that we can both a) load the members list page incrementally and b) search for not-yet-loaded members from the members list page.

This changeset contains the following fundamental changes (with related updates to tests):

  1. Updated the AttendeeService to take in a list of members to determine eligibility, rather than always returning a list of all members. Required to support pagination.
  2. Added pagination support to the member/list endpoint. If a page_size param is sent up, it will only return up to page_size results. The new return format with cursor and has_more is gated based on whether you pass up page_size (for backwards compatibility with the frontend).
  3. Added a new /member/search endpoint which accepts a query parameter. This endpoint will return results where the query string is a substring of first, last or email of a member. It also supports pagination.
  4. Per discussion with @jeffmay and @dbolson, some refactoring to move more business logic into the MemberService and keep mostly "pure" sqlalchemy queries in the MemberRepo
Edited by Anna Geiduschek

Merge request reports