Skip to content

API: search an organization's members by name or address, best matches first - #1913

Merged
davidmckayv merged 1 commit into
mainfrom
feat/one-org-team-add-spec
Nov 20, 2026
Merged

davidmckayv merged 1 commit into
mainfrom
feat/one-org-team-add-spec

Conversation

@davidmckayv

Copy link
Copy Markdown
Contributor

What

listOrganizationMembers takes an optional search query parameter, so a screen can ask the server for the members matching what somebody types instead of loading the whole organization.

  • Matches a member's name, a word of their name (first or last name), or their address, ignoring case.
  • Best matches first: those whose name, a word of it, or their address starts with the text, then those whose name or address holds it, each group in alphabetical order of name, then address.
  • Finds only the organization's current members: never somebody it removed, somebody turned away from this OpenBot, or a member of another organization only.
  • Paged like the list (limit, cursor, nextCursor); a cursor belongs to the search that made it.

Additive only: a new optional query parameter on an existing operation. Without search the list answers exactly as before. Changelog line under Unreleased, API.

Why

Adding people to a team becomes a type-ahead box that suggests the organization's own members as the admin types. listPeople already has a search, but it is for admins only (anybody else sees only themselves, and a team maintainer can add people), it lists people an admin removed, and it matches anywhere without ranking. The members list is readable by any member and is what the team screen already uses.

Checks

  • bun run api:generate: bundle and the app, phone and Recorder clients regenerated and committed together.
  • bun run api:lint: valid.
  • bun test api shared/tests/api: 101 pass, 9 skip, 0 fail.

The screens that use it come in a separate pull request, stacked on the one-org apps work.

…s first

listOrganizationMembers takes an optional search: members whose name, a first or last name, or address starts with it come first, then those whose name or address holds it, ignoring case. Only the organization's current members are listed, and a cursor belongs to the search that made it. Adding people to a team asks the server for the members matching what is typed instead of loading everybody.
@davidmckayv
davidmckayv force-pushed the feat/one-org-team-add-spec branch from acfcbfa to 1b84ea8 Compare November 20, 2026 13:48
@davidmckayv
davidmckayv merged commit 7c497b4 into main Nov 20, 2026
22 checks passed
@davidmckayv
davidmckayv deleted the feat/one-org-team-add-spec branch November 20, 2026 13:55
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.

1 participant