/
voting
/
voting-backend
Обзор
Документация
Войти
/
voting
/
voting-backend
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
main
src/api/admin/events-screen.controller.ts
45 строк
1 KB
pulintim
Запрос на слияние 'docs/update-25' (
#25
) из docs/update-25 в main
18 июл 2026, 21:05
Верифицирован
18 июл 2026, 21:05
80fda85
Код
Авторство
О чём код?
import { Body, Controller, HttpCode, HttpStatus, Param, ParseUUIDPipe, Put } from '@nestjs/common' import { ApiBadRequestResponse, ApiNotFoundResponse, ApiOkResponse, ApiOperation, ApiParam, ApiTags } from '@nestjs/swagger' import { ShowResultService } from '../domain/events/show-result.service' import { ScreenResponseDto } from './dto/screen-response.dto' import { SetScreenDto } from './dto/set-screen.dto' @ApiTags('admin/events') @Controller('admin/events') export class EventsScreenController { constructor(private readonly showResultService: ShowResultService) {} @Put(':eventId/screen') @HttpCode(HttpStatus.OK) @ApiOperation({ summary: 'Set event screen (show result / stage)' }) @ApiParam({ name: 'eventId', format: 'uuid' }) @ApiBadRequestResponse({ description: 'Invalid UUID, validation failed, invalid screenType, or nomination does not belong to event' }) @ApiNotFoundResponse({ description: 'Event or nomination not found' }) @ApiOkResponse({ type: ScreenResponseDto }) async setScreen( @Param('eventId', ParseUUIDPipe) eventId: string, @Body() body: SetScreenDto ): Promise<ScreenResponseDto> { const result = await this.showResultService.showResult( eventId, body.screenType, body.currentNominationId ) return { screenType: result.screenType, currentNominationId: result.currentNominationId, updatedAt: result.updatedAt.toISOString() } } }