update
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
# syntax=docker/dockerfile:1.4
|
||||
|
||||
FROM node:24-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -115,14 +115,29 @@ export class ProfileController {
|
||||
|
||||
@Post('self-delete')
|
||||
@ApiOperation({
|
||||
summary: 'Удалить свой профиль',
|
||||
description: 'Мягко удаляет профиль: помечает аккаунт как удалённый, освобождает логин и контакты для повторной регистрации, сбрасывает роли и завершает все сессии.'
|
||||
summary: 'Запросить удаление своего профиля',
|
||||
description:
|
||||
'Планирует удаление аккаунта через период ожидания ACCOUNT_DELETE_GRACE_DAYS. До истечения срока пользователь может отменить удаление.'
|
||||
})
|
||||
@ApiParam({ name: 'userId', description: 'ID пользователя' })
|
||||
@ApiResponse({ status: 201, description: 'Профиль удалён' })
|
||||
@ApiResponse({ status: 201, description: 'Удаление запланировано' })
|
||||
async selfDelete(@Headers('authorization') authorization: string | undefined, @Param('userId') userId: string) {
|
||||
await this.assertSelfAccess(authorization, userId);
|
||||
return this.core.profile.SoftDeleteProfile({ userId });
|
||||
return this.core.profile.RequestAccountDeletion({ userId });
|
||||
}
|
||||
|
||||
@Post('self-delete/cancel')
|
||||
@ApiOperation({ summary: 'Отменить запланированное удаление профиля' })
|
||||
async cancelSelfDelete(@Headers('authorization') authorization: string | undefined, @Param('userId') userId: string) {
|
||||
await this.assertSelfAccess(authorization, userId);
|
||||
return this.core.profile.CancelAccountDeletion({ userId });
|
||||
}
|
||||
|
||||
@Get('self-delete/status')
|
||||
@ApiOperation({ summary: 'Статус запланированного удаления профиля' })
|
||||
async selfDeleteStatus(@Headers('authorization') authorization: string | undefined, @Param('userId') userId: string) {
|
||||
await this.assertSelfAccess(authorization, userId);
|
||||
return this.core.profile.GetAccountDeletionStatus({ userId });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user