| Total Complexity | 1 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import { Controller, Inject, UseGuards, Post, Param } from '@nestjs/common'; |
||
| 10 | |||
| 11 | @Controller('schools') |
||
| 12 | @ApiTags('School') |
||
| 13 | @ApiBearerAuth() |
||
| 14 | @UseGuards(AuthGuard('bearer'), RolesGuard) |
||
| 15 | export class CreateFileIngestionAction { |
||
| 16 | constructor( |
||
| 17 | @Inject('IQueryBus') |
||
| 18 | private readonly queryBus: IQueryBus, |
||
| 19 | @Inject('IFileUpload') |
||
| 20 | private readonly fileUploadAdapter: IFileUpload |
||
| 21 | ) {} |
||
| 22 | |||
| 23 | @Post(':id/photos/ingestion') |
||
| 24 | @Roles('photographer') |
||
| 25 | @ApiOperation({summary: 'Get enpoint to upload files containing photos'}) |
||
| 26 | public async index(@Param() dto: IdDTO): Promise<SchoolUploadEndpointView> { |
||
| 27 | const url = await this.fileUploadAdapter.getEndPoint(`${dto.id}.zip`); |
||
| 28 | |||
| 29 | return new SchoolUploadEndpointView(url); |
||
| 30 | } |
||
| 32 |