diff --git a/src/client/components/user-moderate-dialog.vue b/src/client/components/user-moderate-dialog.vue
index 894db5384e..46915b2e9e 100644
--- a/src/client/components/user-moderate-dialog.vue
+++ b/src/client/components/user-moderate-dialog.vue
@@ -3,6 +3,7 @@
{{ $t('changePassword') }}
+ {{ $t('moderator') }}
{{ $t('silence') }}
{{ $t('suspend') }}
@@ -34,6 +35,7 @@ export default Vue.extend({
data() {
return {
+ moderator: this.user.isModerator,
silenced: this.user.isSilenced,
suspended: this.user.isSuspended,
};
@@ -94,8 +96,12 @@ export default Vue.extend({
if (confirm.canceled) {
this.suspended = !this.suspended;
} else {
- this.$root.api(this.silenced ? 'admin/suspend-user' : 'admin/unsuspend-user', { userId: this.user.id });
+ this.$root.api(this.suspended ? 'admin/suspend-user' : 'admin/unsuspend-user', { userId: this.user.id });
}
+ },
+
+ async toggleModerator() {
+ this.$root.api(this.moderator ? 'admin/moderators/add' : 'admin/moderators/remove', { userId: this.user.id });
}
}
});