From 5ceffb2c17546e2612f2b149a4de61fdd77348fa Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 30 Jan 2020 06:00:43 +0900 Subject: [PATCH] Add moderator switch --- src/client/components/user-moderate-dialog.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/components/user-moderate-dialog.vue b/src/client/components/user-moderate-dialog.vue index 894db5384..46915b2e9 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 }); } } });