diff --git a/frontend/src/components/InviteList.vue b/frontend/src/components/InviteList.vue index f5a95b9..3c4e232 100644 --- a/frontend/src/components/InviteList.vue +++ b/frontend/src/components/InviteList.vue @@ -29,7 +29,6 @@ const LIFETIMES = [ { days: 30, label: "30 days" }, ]; - const invites = ref([]); const loading = ref(true); const error = ref(""); @@ -41,7 +40,7 @@ const freshLink = ref(""); async function load() { error.value = ""; - await toastOnFailure(async () => { + try { invites.value = (await api.get<{ invites: Invite[] }>("/api/invites")).invites; } catch (e) { error.value = errorMessage(e, "Couldn't load invites."); @@ -71,7 +70,7 @@ async function create() { async function revoke(invite: Invite) { if (!window.confirm(`Revoke the invite for ${who(invite)}? Its link will stop working.`)) return; - try { + await toastOnFailure(async () => { const updated = await api.del(`/api/invites/${invite.id}`); invites.value = invites.value.map((i) => (i.id === updated.id ? updated : i)); }, "Couldn't revoke that invite.");