Skip to content

Commit

Permalink
feat: add response to run legacy project import endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
angelhigueraacid committed May 23, 2022
1 parent de12e84 commit 38d5983
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ export class StartLegacyProjectImportResponseDto {
})
scenarioId!: string;
}

export class RunLegacyProjectImportResponseDto {
@ApiProperty({
description: 'ID of the project',
example: '6fbec34e-04a7-4131-be14-c245f2435a6c',
})
projectId!: string;
}
6 changes: 5 additions & 1 deletion api/apps/api/src/modules/projects/projects.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ import {
unfinishedExport,
} from '../clone/export/application/get-archive.query';
import {
RunLegacyProjectImportResponseDto,
StartLegacyProjectImportBodyDto,
StartLegacyProjectImportResponseDto,
} from './dto/legacy-project-import.dto';
Expand Down Expand Up @@ -223,11 +224,12 @@ export class ProjectsController {
description: 'Runs a legacy project import project',
summary: 'Runs a legacy project import project',
})
@ApiOkResponse({ type: RunLegacyProjectImportResponseDto })
@Post('legacy-project-import/:projectId/run')
async runLegacyProject(
@Param('projectId') projectId: string,
@Req() req: RequestWithAuthenticatedUser,
): Promise<void> {
): Promise<RunLegacyProjectImportResponseDto> {
const result = await this.projectsService.runLegacyProject(
projectId,
req.user.id,
Expand All @@ -252,6 +254,8 @@ export class ProjectsController {
throw new InternalServerErrorException();
}
}

return { projectId };
}

@ImplementsAcl()
Expand Down

0 comments on commit 38d5983

Please sign in to comment.