Allow get invites endpoint to return all invites filtered by status #56
Labels
🛠 API
Can design a new REST API endpoint for BobaBoard's backend
☁️ Average
⏩ Design
Open issues need deliberation before implementation can proceed
🐞 Feature
Add a new feature or improve an existing one
🛠 JavaScript
This task requires an understanding of JavaScript
🎨 Privacy
Ensure everyone's privacy is respected.
💪 Self-contained
The task doesn't have broad repercussions on the BobaBoard codebase
🛶 Small
🛠 SQL
Needs to know how to deal with Postgres table design or query writing
[Currently the get
/realms/realm_id/invites/
endpoint is setup to only return the pending invites for the realm.]The "right" way of doing it would be to return all the invites (with pagination), then have a
status
get param which allows to filter by status. For example, our request could be:/realms/v0/invites?status=PENDING
to only get the pending invites.
Two things that I didn't add in the design that prevents us from doing this the right way:
expired_at
and didn't want to duplicate the information, but I was wrong. We should have a status field which has at least:PENDING
,ACCEPTED
,EXPIRED
(potentially for the futureREVOKED
).Originally posted by @essential-randomness in #53 (comment)
The text was updated successfully, but these errors were encountered: