Conditions | 2 |
Total Lines | 19 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { |
||
29 | |||
30 | @Put(':id') |
||
31 | @Roles(UserRole.PHOTOGRAPHER) |
||
32 | @ApiOperation({ summary: 'Update shooting' }) |
||
33 | public async index(@Param() idDto: IdDTO, @Body() dto: ShootingDTO) { |
||
34 | try { |
||
35 | const { name, closingDate, shootingDate } = dto; |
||
36 | const id = await this.commandBus.execute( |
||
37 | new UpdateShootingCommand( |
||
38 | idDto.id, |
||
39 | name, |
||
40 | new Date(shootingDate), |
||
41 | new Date(closingDate) |
||
42 | ) |
||
43 | ); |
||
44 | |||
45 | return { id }; |
||
46 | } catch (e) { |
||
47 | throw new BadRequestException(e.message); |
||
48 | } |
||
51 |