Part 1 of the relation fix
This commit is contained in:
@@ -24,7 +24,8 @@ export class RunnerController {
|
||||
@OpenAPI({ description: 'Lists all runners.' })
|
||||
async getAll() {
|
||||
let responseRunners: ResponseRunner[] = new Array<ResponseRunner>();
|
||||
const runners = await this.runnerRepository.find();
|
||||
const runners = await this.runnerRepository.find({ relations: ['scans', 'group'] });
|
||||
console.log(runners);
|
||||
runners.forEach(runner => {
|
||||
responseRunners.push(new ResponseRunner(runner));
|
||||
});
|
||||
@@ -37,7 +38,7 @@ export class RunnerController {
|
||||
@OnUndefined(RunnerNotFoundError)
|
||||
@OpenAPI({ description: 'Returns a runner of a specified id (if it exists)' })
|
||||
async getOne(@Param('id') id: number) {
|
||||
return new ResponseRunner(await this.runnerRepository.findOne({ id: id }));
|
||||
return new ResponseRunner(await this.runnerRepository.findOne({ id: id }, { relations: ['scans', 'group'] }));
|
||||
}
|
||||
|
||||
@Post()
|
||||
|
||||
Reference in New Issue
Block a user