@@ -5,7 +5,7 @@ import { EntityFromBody } from 'typeorm-routing-controllers-extensions';
|
||||
import { RunnerGroupNeededError, RunnerGroupNotFoundError, RunnerIdsNotMatchingError, RunnerNotFoundError, RunnerOnlyOneGroupAllowedError } from '../errors/RunnerErrors';
|
||||
import { CreateRunner } from '../models/creation/CreateRunner';
|
||||
import { Runner } from '../models/entities/Runner';
|
||||
|
||||
import { ResponseRunner } from '../models/responses/ResponseRunner';
|
||||
|
||||
@JsonController('/runners')
|
||||
//@Authorized('RUNNERS:read')
|
||||
@@ -20,10 +20,15 @@ export class RunnerController {
|
||||
}
|
||||
|
||||
@Get()
|
||||
@ResponseSchema(Runner, { isArray: true })
|
||||
@ResponseSchema(ResponseRunner, { isArray: true })
|
||||
@OpenAPI({ description: 'Lists all runners.' })
|
||||
getAll() {
|
||||
return this.runnerRepository.find();
|
||||
async getAll() {
|
||||
let responseRunners: ResponseRunner[] = new Array<ResponseRunner>();
|
||||
const runners = await this.runnerRepository.find();
|
||||
runners.forEach(runner => {
|
||||
responseRunners.push(new ResponseRunner(runner));
|
||||
});
|
||||
return responseRunners;
|
||||
}
|
||||
|
||||
@Get('/:id')
|
||||
|
||||
Reference in New Issue
Block a user