| Total Complexity | 2 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import { |
||
| 17 | |||
| 18 | @Controller('shipping-costs') |
||
| 19 | @ApiTags('Order') |
||
| 20 | @ApiBearerAuth() |
||
| 21 | @UseGuards(AuthGuard('bearer'), RolesGuard) |
||
| 22 | export class RemoveShippingCostAction { |
||
| 23 | constructor( |
||
| 24 | @Inject('ICommandBus') |
||
| 25 | private readonly commandBus: ICommandBus |
||
| 26 | ) {} |
||
| 27 | |||
| 28 | @Delete(':id') |
||
| 29 | @Roles(UserRole.PHOTOGRAPHER) |
||
| 30 | @ApiOperation({ summary: 'Remove shipping cost' }) |
||
| 31 | public async index(@Param() { id }: IdDTO) { |
||
| 32 | try { |
||
| 33 | await this.commandBus.execute(new RemoveShippingCostCommand(id)); |
||
| 34 | } catch (e) { |
||
| 35 | throw new BadRequestException(e.message); |
||
| 36 | } |
||
| 39 |