diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts b/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts index ed7a1424dd..ef66e54e2c 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts @@ -37,6 +37,7 @@ export const paramDef = { type: 'object', properties: { userId: { type: 'string', format: 'misskey:id' }, + soft: { type: 'boolean', default: true, description: 'Since deletion by an administrator is a moderation action, the default is to soft delete.' }, }, required: ['userId'], } as const; @@ -56,8 +57,7 @@ export default class extends Endpoint { // eslint- if (user == null) throw new ApiError(meta.errors.userNotFound); if (await this.roleService.isModerator(user)) throw new ApiError(meta.errors.cannotDeleteModerator); - // 管理者からの削除ということはモデレーション行為なので、soft delete にする - await this.deleteAccountService.deleteAccount(user, true, me); + await this.deleteAccountService.deleteAccount(user, ps.soft, me); }); } } diff --git a/packages/frontend/src/pages/admin-user.vue b/packages/frontend/src/pages/admin-user.vue index 59dc0ba0ec..294807ed3d 100644 --- a/packages/frontend/src/pages/admin-user.vue +++ b/packages/frontend/src/pages/admin-user.vue @@ -58,11 +58,16 @@ SPDX-License-Identifier: AGPL-3.0-only
- {{ i18n.ts.suspend }} - -
- {{ i18n.ts.resetPassword }} -
+ + + +
+ {{ i18n.ts.suspend }} + {{ i18n.ts.resetPassword }} + {{ i18n.ts.unsetUserAvatar }} + {{ i18n.ts.unsetUserBanner }} +
+
@@ -87,11 +92,14 @@ SPDX-License-Identifier: AGPL-3.0-only -
- {{ i18n.ts.unsetUserAvatar }} - {{ i18n.ts.unsetUserBanner }} -
- {{ i18n.ts.deleteAccount }} + + + +
+ {{ i18n.ts.deleteAccount }} + {{ i18n.ts.deleteAccount }} ({{ i18n.ts.all }}) +
+
@@ -380,7 +388,7 @@ async function deleteAllFiles() { } } -async function deleteAccount() { +async function deleteAccount(soft: boolean) { const confirm = await os.confirm({ type: 'warning', text: i18n.ts.deleteAccountConfirm, @@ -395,6 +403,7 @@ async function deleteAccount() { if (typed.result === user.value?.username) { await os.apiWithDialog('admin/accounts/delete', { userId: user.value.id, + soft, }).then(refreshUser); } else { os.alert({ diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index 398da6bbe9..f4e5047116 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -5438,6 +5438,11 @@ export type operations = { 'application/json': { /** Format: misskey:id */ userId: string; + /** + * @description Since deletion by an administrator is a moderation action, the default is to soft delete. + * @default true + */ + soft?: boolean; }; }; };