Skip to content

Commit

Permalink
Fixed issue with remove subscriber confirmation message
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Aug 15, 2023
1 parent c881b29 commit bdb84cf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions webroot/js/members.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ export default {
this.loading = false;

},
async removeSubscriber({name, friendlyName}, {id, label}) {
async removeSubscriber(group, subscriber) {
const {name, friendlyName} = group;
const {id, name: subName, label} = subscriber;
this.loading = true;
const resp = await fetch(`${this.api.remove}?group=${(name)}&userId=${id}`, {
method: "DELETE",
Expand All @@ -91,15 +93,16 @@ export default {
if (resp.ok) {
this.subscribers = [];
this.loadGroupSubscribers(this.group);
generateFlash(`${label} ${this.txt.removeSubscriberSuccess} ${(friendlyName)}`, 'success');
generateFlash(`${label || subName} ${this.txt.removeSubscriberSuccess} ${(friendlyName)}`, 'success');
} else {
this.disabled = [ ...this.disabled, id ];
generateFlash(this.txt.removeSubscriberError, 'error');
}

this.loading = false;
},
async addSubscriber({ identifier: id, label }) {
async addSubscriber(user) {
const { identifier: id, label } = user;
this.loading = true;
const { friendlyName, name } = this.group;
const formData = new FormData();
Expand Down

0 comments on commit bdb84cf

Please sign in to comment.