Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: enhance swagger on updateBoardPhase #1160

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion backend/src/modules/boards/controller/boards.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import { TYPES } from '../interfaces/types';
import { BoardUserGuard } from 'src/libs/guards/boardRoles.guard';
import UpdateBoardUserDto from '../dto/update-board-user.dto';
import { BoardPhaseDto } from 'src/libs/dto/board-phase.dto';
import { BoardPhases } from 'src/libs/enum/board.phases';

const BoardUser = (permissions: string[]) => SetMetadata('permissions', permissions);

Expand Down Expand Up @@ -343,13 +344,29 @@ export default class BoardsController {
}

@ApiOperation({ summary: 'Update board phase' })
@ApiBody({
schema: {
properties: {
boardId: { type: 'string' },
phase: {
enum: [BoardPhases.ADDCARDS, BoardPhases.VOTINGPHASE, BoardPhases.SUBMITED],
example: [BoardPhases.ADDCARDS, BoardPhases.VOTINGPHASE, BoardPhases.SUBMITED]
}
}
}
})
@ApiOkResponse({
description: 'Board in voting phase'
description: 'Phase successfully updated',
type: BoardPhaseDto
})
@ApiInternalServerErrorResponse({
description: 'Internal Server Error',
type: InternalServerErrorResponse
})
@ApiUnauthorizedResponse({
description: 'Unauthorized',
type: UnauthorizedResponse
})
@Put(':boardId/phase')
async updateBoardPhase(@Body() boardPhaseDto: BoardPhaseDto) {
this.updateBoardApp.updatePhase(boardPhaseDto);
Expand Down