Update GroupSettings, add missing avatar/header deletion

pull/5914/head
Daniel Supernault 8 months ago
parent 375858f09d
commit d19b6afd55
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1

@ -228,7 +228,7 @@
Update Update
</a> </a>
<span class="mx-1">·</span> <span class="mx-1">·</span>
<a href="" class="text-danger font-weight-bold"> <a href="#" class="text-danger font-weight-bold" @click.prevent="handleDeleteAvatar()">
Delete Delete
</a> </a>
</p> </p>
@ -256,7 +256,7 @@
Update Update
</a> </a>
<span class="mx-1">·</span> <span class="mx-1">·</span>
<a href="" class="text-danger font-weight-bold"> <a href="#" class="text-danger font-weight-bold" @click.prevent="handleDeleteHeader()">
Delete Delete
</a> </a>
</p> </p>
@ -983,6 +983,30 @@
return `/groups/${this.groupId}/members?a=il&pid=${pid}`; return `/groups/${this.groupId}/members?a=il&pid=${pid}`;
}, },
handleDeleteAvatar() {
if(!window.confirm('Are you sure you want to delete your group avatar image?')) {
return;
}
this.savingChanges = true;
axios.post('/api/v0/groups/' + this.group.id + '/settings/delete-avatar')
.then(res => {
this.savingChanges = false;
this.group = res.data;
});
},
handleDeleteHeader() {
if(!window.confirm('Are you sure you want to delete your group header image?')) {
return;
}
this.savingChanges = true;
axios.post('/api/v0/groups/' + this.group.id + '/settings/delete-header')
.then(res => {
this.savingChanges = false;
this.group = res.data;
});
},
undoBlock(type, val) { undoBlock(type, val) {
let action = type == 'moderate' ? `unblock ${val}?` : `allow anyone to join without approval from ${val}?`; let action = type == 'moderate' ? `unblock ${val}?` : `allow anyone to join without approval from ${val}?`;
swal({ swal({

Loading…
Cancel
Save