Retrait des @ApiForbiddenResponse puisque nous ne renvoyons aucune erreur 403
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete, ParseIntPipe, HttpCode, UseGuards, Req, Query, NotFoundException } from '@nestjs/common'
|
||||
import { ChallengeActionsService } from './challenge-actions.service'
|
||||
import { AuthenticatedRequest, JwtAuthGuard } from 'src/auth/jwt-auth.guard'
|
||||
import { ApiBearerAuth, ApiCreatedResponse, ApiForbiddenResponse, ApiNotFoundResponse, ApiOkResponse, ApiUnauthorizedResponse } from '@nestjs/swagger'
|
||||
import { ApiBearerAuth, ApiCreatedResponse, ApiNotFoundResponse, ApiOkResponse, ApiUnauthorizedResponse, ApiUnprocessableEntityResponse } from '@nestjs/swagger'
|
||||
import { ChallengeActionEntity } from './entities/challenge-action.entity'
|
||||
import { CreateChallengeActionDto } from './dto/create-challenge-action.dto'
|
||||
import { ApiOkResponsePaginated, paginateOutput } from 'src/common/utils/pagination.utils'
|
||||
@ -21,7 +21,6 @@ export class ChallengeActionsController {
|
||||
@ApiBearerAuth()
|
||||
@ApiCreatedResponse({ type: ChallengeActionEntity, description: "Objet créé avec succès" })
|
||||
@ApiUnauthorizedResponse({ description: "Non authentifié⋅e" })
|
||||
@ApiForbiddenResponse({ description: "Permission refusée" })
|
||||
async create(@Req() request: AuthenticatedRequest, @Body() createChallengeActionDto: CreateChallengeActionDto): Promise<ChallengeActionEntity> {
|
||||
const challenge = await this.challengeActionsService.create(request.user, createChallengeActionDto)
|
||||
return new ChallengeActionEntity(challenge)
|
||||
@ -32,7 +31,6 @@ export class ChallengeActionsController {
|
||||
@ApiBearerAuth()
|
||||
@ApiOkResponsePaginated(ChallengeActionEntity)
|
||||
@ApiUnauthorizedResponse({ description: "Non authentifié⋅e" })
|
||||
@ApiForbiddenResponse({ description: "Permission refusée" })
|
||||
async findAll(@Query() queryPagination: QueryPaginationDto, @Query() filterChallengeActions: FilterChallengeActionsDto): Promise<PaginateOutputDto<ChallengeActionEntity>> {
|
||||
const [challengeActions, total] = await this.challengeActionsService.findAll(queryPagination, filterChallengeActions)
|
||||
return paginateOutput<ChallengeActionEntity>(challengeActions.map(challengeAction => new ChallengeActionEntity(challengeAction)), total, queryPagination)
|
||||
@ -43,7 +41,6 @@ export class ChallengeActionsController {
|
||||
@ApiBearerAuth()
|
||||
@ApiOkResponse({ type: ChallengeActionEntity })
|
||||
@ApiUnauthorizedResponse({ description: "Non authentifié⋅e" })
|
||||
@ApiForbiddenResponse({ description: "Permission refusée" })
|
||||
@ApiNotFoundResponse({ description: "Objet non trouvé" })
|
||||
async findOne(@Param('id', ParseIntPipe) id: number): Promise<ChallengeActionEntity> {
|
||||
const challenge = await this.challengeActionsService.findOne(id)
|
||||
@ -57,7 +54,6 @@ export class ChallengeActionsController {
|
||||
@ApiBearerAuth()
|
||||
@ApiOkResponse({ type: ChallengeActionEntity })
|
||||
@ApiUnauthorizedResponse({ description: "Non authentifié⋅e" })
|
||||
@ApiForbiddenResponse({ description: "Permission refusée" })
|
||||
@ApiNotFoundResponse({ description: "Objet non trouvé" })
|
||||
async update(@Param('id', ParseIntPipe) id: number, @Body() updateChallengeActionDto: UpdateChallengeActionDto) {
|
||||
return await this.challengeActionsService.update(id, updateChallengeActionDto)
|
||||
@ -69,7 +65,6 @@ export class ChallengeActionsController {
|
||||
@ApiBearerAuth()
|
||||
@ApiOkResponse({ type: ChallengeActionEntity })
|
||||
@ApiUnauthorizedResponse({ description: "Non authentifié⋅e" })
|
||||
@ApiForbiddenResponse({ description: "Permission refusée" })
|
||||
@ApiNotFoundResponse({ description: "Objet non trouvé" })
|
||||
async remove(@Param('id', ParseIntPipe) id: number) {
|
||||
await this.challengeActionsService.remove(id)
|
||||
@ -80,7 +75,6 @@ export class ChallengeActionsController {
|
||||
@ApiBearerAuth()
|
||||
@ApiOkResponse({ type: ChallengeActionEntity })
|
||||
@ApiUnauthorizedResponse({ description: "Non authentifié⋅e" })
|
||||
@ApiForbiddenResponse({ description: "Permission refusée" })
|
||||
@ApiNotFoundResponse({ description: "Objet non trouvé" })
|
||||
async endCurrent(@Req() request: AuthenticatedRequest, @Body() { success }: EndChallengeActionDto): Promise<ChallengeActionEntity> {
|
||||
const challengeAction = await this.challengeActionsService.endCurrentChallenge(request.user, success)
|
||||
|
Reference in New Issue
Block a user