Conditions | 2 |
Total Lines | 13 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { Inject } from '@nestjs/common'; |
||
13 | |||
14 | public async execute(command: UpdateShootingCommand): Promise<string> { |
||
15 | const { name, closingDate, shootingDate, id } = command; |
||
16 | |||
17 | const shooting = await this.shootingRepository.findOneById(id); |
||
18 | if (!shooting) { |
||
19 | throw new ShootingNotFoundException(); |
||
20 | } |
||
21 | |||
22 | shooting.update(name, shootingDate, closingDate); |
||
23 | await this.shootingRepository.save(shooting); |
||
24 | |||
25 | return shooting.getId(); |
||
26 | } |
||
28 |