From ed50d8e446aad1a551f0097549bef42f1f4dd7f5 Mon Sep 17 00:00:00 2001 From: Julian Krauser Date: Sun, 24 Nov 2024 12:36:03 +0100 Subject: [PATCH] invite management --- src/components/admin/user/user/InviteListItem.vue | 4 +++- src/stores/admin/invite.ts | 4 ++-- src/views/admin/user/User.vue | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/admin/user/user/InviteListItem.vue b/src/components/admin/user/user/InviteListItem.vue index f1f9f87..b7573d7 100644 --- a/src/components/admin/user/user/InviteListItem.vue +++ b/src/components/admin/user/user/InviteListItem.vue @@ -40,7 +40,9 @@ export default defineComponent({ }, methods: { ...mapActions(useInviteStore, ["deleteInvite"]), - triggerDeleteInvite() {}, + triggerDeleteInvite() { + this.deleteInvite(this.invite.mail); + }, }, }); diff --git a/src/stores/admin/invite.ts b/src/stores/admin/invite.ts index 0600dc9..80526b4 100644 --- a/src/stores/admin/invite.ts +++ b/src/stores/admin/invite.ts @@ -24,8 +24,8 @@ export const useInviteStore = defineStore("invite", { this.loading = "failed"; }); }, - deleteInvite(invite: number): Promise> { - return http.delete(`/admin/invite/${invite}`).then((result) => { + deleteInvite(mail: string): Promise> { + return http.delete(`/admin/invite/${mail}`).then((result) => { this.fetchInvites(); return result; }); diff --git a/src/views/admin/user/User.vue b/src/views/admin/user/User.vue index 6d1df32..9650cfd 100644 --- a/src/views/admin/user/User.vue +++ b/src/views/admin/user/User.vue @@ -41,6 +41,10 @@ export default defineComponent({ }, methods: { ...mapActions(useUserStore, ["fetchUsers"]), + ...mapActions(useModalStore, ["openModal"]), + inviteUser() { + this.openModal(markRaw(defineAsyncComponent(() => import("@/components/admin/user/user/InviteUserModal.vue")))); + }, }, });