diff --git a/src/stores/admin/club/member/member.ts b/src/stores/admin/club/member/member.ts index 1e1a30e..c7892c2 100644 --- a/src/stores/admin/club/member/member.ts +++ b/src/stores/admin/club/member/member.ts @@ -40,6 +40,11 @@ export const useMemberStore = defineStore("member", { this.loading = "failed"; }); }, + async getAllMembers(): Promise> { + return await http.get(`/admin/member?noLimit=true`).then((res) => { + return { ...res, data: res.data.members }; + }); + }, async getMembersByIds(ids: Array): Promise> { return await http.get(`/admin/member?ids=${ids.join(",")}&noLimit=true`).then((res) => { return { ...res, data: res.data.members }; diff --git a/src/views/admin/club/newsletter/NewsletterRecipients.vue b/src/views/admin/club/newsletter/NewsletterRecipients.vue index 0271704..0a18c1a 100644 --- a/src/views/admin/club/newsletter/NewsletterRecipients.vue +++ b/src/views/admin/club/newsletter/NewsletterRecipients.vue @@ -27,8 +27,6 @@ title="weitere Empfänger suchen" v-model="recipients" :disabled="!can('create', 'club', 'newsletter')" - @add:member="(s) => members.push(s)" - @add:member-by-array="(s) => members.push(...s)" />

Ausgewählte Empfänger

@@ -149,9 +147,10 @@ export default defineComponent({ // this.fetchNewsletterRecipients(); this.fetchQueries(); this.loadQuery(); + this.loadMembers(); }, methods: { - ...mapActions(useMemberStore, ["fetchMembers"]), + ...mapActions(useMemberStore, ["getAllMembers"]), ...mapActions(useNewsletterRecipientsStore, ["fetchNewsletterRecipients"]), ...mapActions(useQueryStoreStore, ["fetchQueries"]), ...mapActions(useQueryBuilderStore, ["sendQuery"]), @@ -161,6 +160,13 @@ export default defineComponent({ this.recipients.splice(index, 1); } }, + loadMembers() { + this.getAllMembers() + .then((res) => { + this.members = res.data; + }) + .catch(() => {}); + }, loadQuery() { if (this.recipientsByQuery) { this.sendQuery(0, 1000, this.recipientsByQuery.query);