Total Complexity | 1 |
Total Lines | 16 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import { Controller, Inject, UseGuards, Get } from '@nestjs/common'; |
||
10 | |||
11 | @Controller('shipping-costs') |
||
12 | @ApiTags('Order') |
||
13 | @ApiBearerAuth() |
||
14 | @UseGuards(AuthGuard('bearer'), RolesGuard) |
||
15 | export class GetShippingCostsAction { |
||
16 | constructor( |
||
17 | @Inject('IQueryBus') |
||
18 | private readonly queryBus: IQueryBus |
||
19 | ) {} |
||
20 | |||
21 | @Get() |
||
22 | @Roles(UserRole.PHOTOGRAPHER) |
||
23 | @ApiOperation({summary: 'Get all shipping costs'}) |
||
24 | public async index(): Promise<ShippingCostView[]> { |
||
25 | return await this.queryBus.execute(new GetShippingCostsQuery()); |
||
26 | } |
||
28 |