nestjs-api-tools
Version:
Wrappers for convenient API development including validation, logging and i18n wrappers
11 lines (9 loc) • 402 B
text/typescript
import {ApiErrorResponse} from '../../interfaces';
import {ApiUnauthorizedResponse} from '@nestjs/swagger';
/**
* 401 response decorator for Swagger autogenerated documentation.
*/
export const UnauthorizedApiResponse = (description = 'Пользователь не авторизован'): MethodDecorator & ClassDecorator => ApiUnauthorizedResponse({
description,
type: ApiErrorResponse,
});