hedgedoc/src/api/utils/fullapi-decorator.ts
Thomas Snowden 7087135ea4
Add API decorator to reduce clutter
Signed-off-by: Thomas Snowden <zapperchamp1@gmail.com>
2021-04-24 19:10:16 -04:00

20 lines
662 B
TypeScript

/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { applyDecorators } from '@nestjs/common';
import {
ApiForbiddenResponse,
ApiNotFoundResponse,
ApiUnauthorizedResponse,
} from '@nestjs/swagger';
import { forbiddenDescription, notFoundDescription } from './descriptions';
// eslint-disable-next-line @typescript-eslint/naming-convention
export const FullApi = applyDecorators(
ApiForbiddenResponse({ description: forbiddenDescription }),
ApiNotFoundResponse({ description: notFoundDescription }),
ApiUnauthorizedResponse({ description: forbiddenDescription }),
);