Add API decorator to reduce clutter

Signed-off-by: Thomas Snowden <zapperchamp1@gmail.com>
This commit is contained in:
Thomas Snowden 2021-04-24 19:10:16 -04:00 committed by David Mehren
parent eaf1852fe5
commit 7087135ea4
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
3 changed files with 31 additions and 31 deletions

View file

@ -0,0 +1,20 @@
/*
* 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 }),
);