mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 03:57:06 -04:00
Add API decorator to reduce clutter
Signed-off-by: Thomas Snowden <zapperchamp1@gmail.com>
This commit is contained in:
parent
eaf1852fe5
commit
7087135ea4
3 changed files with 31 additions and 31 deletions
20
src/api/utils/fullapi-decorator.ts
Normal file
20
src/api/utils/fullapi-decorator.ts
Normal 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 }),
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue