Part 1 of the relation fix
This commit is contained in:
@@ -54,7 +54,7 @@ export class Runner extends Participant {
|
||||
* Returns the total distance ran by this runner.
|
||||
*/
|
||||
@IsInt()
|
||||
public async distance(): Promise<number> {
|
||||
return await (await this.getValidScans()).reduce((sum, current) => sum + current.distance, 0);
|
||||
public get distance(): number {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ export class ResponseRunner {
|
||||
this.lastname = runner.lastname;
|
||||
this.phone = runner.phone;
|
||||
this.email = runner.email;
|
||||
this.distance = runner.distance;
|
||||
this.distance = runner.scans.reduce((sum, current) => sum + current.distance, 0);
|
||||
this.group = runner.group;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user