Conditions | 2 |
Total Lines | 11 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { Controller, Inject, UseGuards, Get, Param, NotFoundException } from '@nestjs/common'; |
||
20 | |||
21 | @Get(':id/count-discounts') |
||
22 | @Roles(UserRole.PHOTOGRAPHER) |
||
23 | @ApiOperation({ summary: 'Count school discounts' }) |
||
24 | public async index(@Param() { id }: IdDTO) { |
||
25 | try { |
||
26 | const total = await this.queryBus.execute(new CountDiscountsBySchoolQuery(id)); |
||
27 | |||
28 | return { total }; |
||
29 | } catch (e) { |
||
30 | throw new NotFoundException(e.message); |
||
31 | } |
||
34 |