parent
24de82f6df
commit
cc68948a20
@ -81,7 +81,7 @@ export class RunnerController {
|
|||||||
throw new RunnerIdsNotMatchingError();
|
throw new RunnerIdsNotMatchingError();
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.runnerRepository.update(oldRunner, await runner.toRunner());
|
await this.runnerRepository.save(await runner.updateRunner(oldRunner));
|
||||||
return new ResponseRunner(await this.runnerRepository.findOne({ id: id }, { relations: ['scans', 'group'] }));
|
return new ResponseRunner(await this.runnerRepository.findOne({ id: id }, { relations: ['scans', 'group'] }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,19 +24,16 @@ export class UpdateRunner extends CreateParticipant {
|
|||||||
/**
|
/**
|
||||||
* Creates a Runner entity from this.
|
* Creates a Runner entity from this.
|
||||||
*/
|
*/
|
||||||
public async toRunner(): Promise<Runner> {
|
public async updateRunner(runner: Runner): Promise<Runner> {
|
||||||
let newRunner: Runner = new Runner();
|
runner.firstname = this.firstname;
|
||||||
|
runner.middlename = this.middlename;
|
||||||
|
runner.lastname = this.lastname;
|
||||||
|
runner.phone = this.phone;
|
||||||
|
runner.email = this.email;
|
||||||
|
runner.group = await this.getGroup();
|
||||||
|
runner.address = await this.getAddress();
|
||||||
|
|
||||||
newRunner.id = this.id;
|
return runner;
|
||||||
newRunner.firstname = this.firstname;
|
|
||||||
newRunner.middlename = this.middlename;
|
|
||||||
newRunner.lastname = this.lastname;
|
|
||||||
newRunner.phone = this.phone;
|
|
||||||
newRunner.email = this.email;
|
|
||||||
newRunner.group = await this.getGroup();
|
|
||||||
newRunner.address = await this.getAddress();
|
|
||||||
|
|
||||||
return newRunner;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user