resolve manual DTOs
This commit is contained in:
22
apps/api/src/domain/protests/ProtestsController.ts
Normal file
22
apps/api/src/domain/protests/ProtestsController.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Controller, Post, Body, HttpCode, HttpStatus, Param } from '@nestjs/common';
|
||||
import { ApiTags, ApiResponse, ApiOperation, ApiParam } from '@nestjs/swagger';
|
||||
import { RaceService } from '../race/RaceService';
|
||||
import { ReviewProtestCommandDTO } from '../race/dtos/ReviewProtestCommandDTO';
|
||||
|
||||
@ApiTags('protests')
|
||||
@Controller('protests')
|
||||
export class ProtestsController {
|
||||
constructor(private readonly raceService: RaceService) {}
|
||||
|
||||
@Post(':protestId/review')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@ApiOperation({ summary: 'Review a protest' })
|
||||
@ApiParam({ name: 'protestId', description: 'Protest ID' })
|
||||
@ApiResponse({ status: 200, description: 'Protest reviewed successfully' })
|
||||
async reviewProtest(
|
||||
@Param('protestId') protestId: string,
|
||||
@Body() body: Omit<ReviewProtestCommandDTO, 'protestId'>,
|
||||
): Promise<void> {
|
||||
return this.raceService.reviewProtest({ protestId, ...body });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user