Skip to content

Commit

Permalink
updated swagger doc for 403 and 401
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajen07 committed Jun 10, 2024
1 parent e1cac24 commit 7c3ad8e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/teams/teams.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
VoyageTeamResponse,
} from "./teams.response";
import {
ForbiddenErrorResponse,
NotFoundErrorResponse,
UnauthorizedErrorResponse,
} from "../global/responses/errors";
Expand All @@ -39,6 +40,16 @@ export class TeamsController {
type: VoyageTeamResponse,
isArray: true,
})
@ApiResponse({
status: HttpStatus.UNAUTHORIZED,
description: "unauthorized access - user is not logged in",
type: UnauthorizedErrorResponse,
})
@ApiResponse({
status: HttpStatus.FORBIDDEN,
description: "forbidden - user does not have the required permission",
type: ForbiddenErrorResponse,
})
@CheckAbilities({ action: Action.Manage, subject: "all" })
@Get()
findAll() {
Expand Down Expand Up @@ -69,6 +80,16 @@ export class TeamsController {
required: true,
example: 1,
})
@ApiResponse({
status: HttpStatus.UNAUTHORIZED,
description: "unauthorized access - user is not logged in",
type: UnauthorizedErrorResponse,
})
@ApiResponse({
status: HttpStatus.FORBIDDEN,
description: "forbidden - user does not have the required permission",
type: ForbiddenErrorResponse,
})
@CheckAbilities({ action: Action.Manage, subject: "all" })
@Get("voyages/:voyageId")
findTeamsByVoyageId(@Param("voyageId", ParseIntPipe) voyageId: number) {
Expand Down

0 comments on commit 7c3ad8e

Please sign in to comment.