mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 01:36:29 -05:00
fix: openapi decorator
This now correctly returns the dto if it is provided. Previously it would return () => undefined, when the dto was not defined, which crashed some internal logic in nestjs. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
bb2c248147
commit
cf5c398933
1 changed files with 2 additions and 2 deletions
|
@ -106,7 +106,7 @@ export const OpenApi = (
|
|||
ApiOkResponse({
|
||||
description: description ?? okDescription,
|
||||
isArray: isArray,
|
||||
type: () => dto,
|
||||
type: dto ? (): BaseDto => dto as BaseDto : undefined,
|
||||
}),
|
||||
);
|
||||
break;
|
||||
|
@ -115,7 +115,7 @@ export const OpenApi = (
|
|||
ApiCreatedResponse({
|
||||
description: description ?? createdDescription,
|
||||
isArray: isArray,
|
||||
type: () => dto,
|
||||
type: dto ? (): BaseDto => dto as BaseDto : undefined,
|
||||
}),
|
||||
HttpCode(201),
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue