enhance(moderation): 管理者がアカウントの物理削除・論理削除を選べるように (MisskeyIO#581)
This commit is contained in:
parent
acc10c0709
commit
b4420f895e
3 changed files with 27 additions and 13 deletions
|
|
@ -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<typeof meta, typeof paramDef> { // 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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue