diff --git a/src/routes/iam/index.svelte b/src/routes/iam/index.svelte index 8c33d5a38..1ebfaac60 100644 --- a/src/routes/iam/index.svelte +++ b/src/routes/iam/index.svelte @@ -32,6 +32,7 @@ export let account; export let accounts; + export let invitations; if (accounts.length === 0) { accounts.push(account); } @@ -74,12 +75,51 @@ return errorNotification(error); } } + async function acceptInvitation(id, teamId) { + try { + await post(`/iam/team/${teamId}/invitation/accept.json`, { id }); + return window.location.reload(); + } catch ({ error }) { + return errorNotification(error); + } + } + async function revokeInvitation(id, teamId) { + try { + await post(`/iam/team/${teamId}/invitation/revoke.json`, { id }); + return window.location.reload(); + } catch ({ error }) { + return errorNotification(error); + } + }