patches v1.1.2 #47

Merged
jkeffects merged 2 commits from develop into main 2025-01-21 08:00:12 +00:00
2 changed files with 14 additions and 3 deletions
Showing only changes of commit 883559d8a5 - Show all commits

View file

@ -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 };

View file

@ -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);