stack
stack copied to clipboard
[Feature Request] API to get invitations by user
It'd be nice to have an API for listing a user's current unaccepted/rejected invitations.
For example,
const user = useUser();
user.getPendingTeamInvitations(); // Lists all un-accepted/reject invitations
As far as I can tell, the only API to retrieve invitations is:
https://docs.stack-auth.com/next/rest-api/client/teams/list-team-invitations
This retrieves invitations for a specific team. In my application, I'd like to pull invitations for a specific user. I'd like to display a list of "pending invites" in my application.
@fomalhautb If you are okay with it, I'd like to create a PR that adds an API for pulling invitations by user.
Proposal
Add a function:
const user = useUser();
// Pulls a list of invitations for all teams the user has been invited to
user.listInvitations()