Fixed response bug

ref #174
This commit is contained in:
Nicolai Ort 2021-03-26 16:45:30 +01:00
parent dcb12b0ac2
commit ccb7ae29a3

View File

@ -57,12 +57,10 @@ export class RunnerSelfServiceController {
@OnUndefined(RunnerNotFoundError)
@OpenAPI({ description: 'Deletes all information about yourself. <br> Please provide your runner jwt(that code we gave you during registration) for auth. <br> If you lost your jwt/personalized link please use the forgot endpoint.' })
async remove(@Param('jwt') token: string, @QueryParam("force") force: boolean) {
let runner = await this.getRunner(token);
runner = await this.runnerRepository.findOne({ id: runner.id });
const responseRunner = await this.getRunner(token);
let runner = await this.runnerRepository.findOne({ id: responseRunner.id });
if (!runner) { return null; }
const responseRunner = await this.runnerRepository.findOne(runner, { relations: ['scans', 'group', 'group.parentGroup', 'scans.track', 'cards'] });
if (!runner) {
throw new RunnerNotFoundError();
}