From 437730fb435ea4a91889b44b900d536652bf1af2 Mon Sep 17 00:00:00 2001 From: Mrika Llabani Date: Wed, 15 May 2024 12:20:20 +0200 Subject: [PATCH] N21-1935 enum + response fix --- .../board/controller/media-board/dto/media-board.response.ts | 1 + .../board/controller/media-board/dto/media-line.response.ts | 4 ++++ .../media-board/mapper/media-line-response.mapper.ts | 1 + .../board/controller/media-board/media-line.controller.ts | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/server/src/modules/board/controller/media-board/dto/media-board.response.ts b/apps/server/src/modules/board/controller/media-board/dto/media-board.response.ts index 10d02fb83ef..fcc4ec569e8 100644 --- a/apps/server/src/modules/board/controller/media-board/dto/media-board.response.ts +++ b/apps/server/src/modules/board/controller/media-board/dto/media-board.response.ts @@ -17,6 +17,7 @@ export class MediaBoardResponse { timestamps: TimestampsResponse; @ApiProperty({ + enum: MediaBoardLayoutType, description: 'Layout of media board', }) layout: MediaBoardLayoutType; diff --git a/apps/server/src/modules/board/controller/media-board/dto/media-line.response.ts b/apps/server/src/modules/board/controller/media-board/dto/media-line.response.ts index 4b0a41b9721..30c891c3d01 100644 --- a/apps/server/src/modules/board/controller/media-board/dto/media-line.response.ts +++ b/apps/server/src/modules/board/controller/media-board/dto/media-line.response.ts @@ -23,11 +23,15 @@ export class MediaLineResponse { @ApiProperty({ description: 'The background color of the media line' }) backgroundColor: string; + @ApiProperty({ description: 'Collapse the media line' }) + collapsed: boolean; + constructor(props: MediaLineResponse) { this.id = props.id; this.title = props.title; this.elements = props.elements; this.timestamps = props.timestamps; this.backgroundColor = props.backgroundColor; + this.collapsed = props.collapsed; } } diff --git a/apps/server/src/modules/board/controller/media-board/mapper/media-line-response.mapper.ts b/apps/server/src/modules/board/controller/media-board/mapper/media-line-response.mapper.ts index 9a4e42d523d..e299b13a5a7 100644 --- a/apps/server/src/modules/board/controller/media-board/mapper/media-line-response.mapper.ts +++ b/apps/server/src/modules/board/controller/media-board/mapper/media-line-response.mapper.ts @@ -23,6 +23,7 @@ export class MediaLineResponseMapper { createdAt: line.createdAt, }), backgroundColor: line.backgroundColor, + collapsed: line.collapsed, }); return lineResponse; diff --git a/apps/server/src/modules/board/controller/media-board/media-line.controller.ts b/apps/server/src/modules/board/controller/media-board/media-line.controller.ts index 5292033d498..6e592bbbdea 100644 --- a/apps/server/src/modules/board/controller/media-board/media-line.controller.ts +++ b/apps/server/src/modules/board/controller/media-board/media-line.controller.ts @@ -84,7 +84,7 @@ export class MediaLineController { @ApiNotFoundResponse({ type: NotFoundException }) @HttpCode(HttpStatus.NO_CONTENT) @Patch(':lineId/collapse') - public async collapsMediaLine( + public async collapseMediaLine( @Param() urlParams: BoardUrlParams, @Body() bodyParams: CollapsableBodyParams, @CurrentUser() currentUser: ICurrentUser