fix: get all members for newletter recipients query
This commit is contained in:
parent
45ad07a906
commit
883559d8a5
2 changed files with 14 additions and 3 deletions
|
@ -40,6 +40,11 @@ export const useMemberStore = defineStore("member", {
|
|||
this.loading = "failed";
|
||||
});
|
||||
},
|
||||
async getAllMembers(): Promise<AxiosResponse<any, any>> {
|
||||
return await http.get(`/admin/member?noLimit=true`).then((res) => {
|
||||
return { ...res, data: res.data.members };
|
||||
});
|
||||
},
|
||||
async getMembersByIds(ids: Array<number>): Promise<AxiosResponse<any, any>> {
|
||||
return await http.get(`/admin/member?ids=${ids.join(",")}&noLimit=true`).then((res) => {
|
||||
return { ...res, data: res.data.members };
|
||||
|
|
|
@ -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)"
|
||||
/>
|
||||
|
||||
<p>Ausgewählte Empfänger</p>
|
||||
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue