Update GroupSettings, add missing avatar/header deletion

pull/5914/head
Daniel Supernault 2025-03-31 23:45:54 -06:00
rodzic 375858f09d
commit d19b6afd55
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 23740873EE6F76A1
1 zmienionych plików z 26 dodań i 2 usunięć

Wyświetl plik

@ -228,7 +228,7 @@
Update
</a>
<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
</a>
</p>
@ -256,7 +256,7 @@
Update
</a>
<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
</a>
</p>
@ -983,6 +983,30 @@
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) {
let action = type == 'moderate' ? `unblock ${val}?` : `allow anyone to join without approval from ${val}?`;
swal({