diff --git a/src/client/components/user-moderate-dialog.vue b/src/client/components/user-moderate-dialog.vue
index f45342564..61b8dd0ba 100644
--- a/src/client/components/user-moderate-dialog.vue
+++ b/src/client/components/user-moderate-dialog.vue
@@ -3,7 +3,7 @@
{{ $t('resetPassword') }}
- {{ $t('moderator') }}
+ {{ $t('moderator') }}
{{ $t('silence') }}
{{ $t('suspend') }}
@@ -47,7 +47,7 @@ export default Vue.extend({
type: 'waiting',
iconOnly: true
});
-
+
this.$root.api('admin/reset-password', {
userId: this.user.id,
}).then(({ password }) => {
diff --git a/src/server/api/endpoints/admin/moderators/add.ts b/src/server/api/endpoints/admin/moderators/add.ts
index 71a214928..fd862a9a4 100644
--- a/src/server/api/endpoints/admin/moderators/add.ts
+++ b/src/server/api/endpoints/admin/moderators/add.ts
@@ -32,6 +32,10 @@ export default define(meta, async (ps) => {
throw new Error('user not found');
}
+ if (user.isAdmin) {
+ throw new Error('cannot mark as moderator if admin user');
+ }
+
await Users.update(user.id, {
isModerator: true
});