Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow get invites endpoint to return all invites filtered by status #56

Open
virtuous-cat opened this issue Apr 10, 2022 · 0 comments
Open
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

Comments

@virtuous-cat
Copy link
Member

[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:

  1. We don't have a status enum we return with the invite. This is because I thought we'd just calculate it with 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 future REVOKED).
  2. We don't have pagination for this endpoint, which is not a huge deal for now if we're returning only pending invites, but will be at some point in the future.

Originally posted by @essential-randomness in #53 (comment)

@virtuous-cat virtuous-cat added 🛠 SQL Needs to know how to deal with Postgres table design or query writing 🔥🔥P3 🛠 API Can design a new REST API endpoint for BobaBoard's backend 🛠 JavaScript This task requires an understanding of JavaScript 🐞 Feature Add a new feature or improve an existing one 🛶 Small 💪 Self-contained The task doesn't have broad repercussions on the BobaBoard codebase 🎨 Privacy Ensure everyone's privacy is respected. ☁️ Average ⏩ Design Open issues need deliberation before implementation can proceed labels Sep 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants