Fixed amount calculations

This commit is contained in:
2020-12-04 22:07:30 +01:00
parent b480912bd8
commit afef95e14e
4 changed files with 15 additions and 9 deletions

View File

@@ -54,7 +54,7 @@ export class Runner extends Participant {
* Returns the total distance ran by this runner.
*/
@IsInt()
public get distance(): number {
return 0;
public async distance(): Promise<number> {
return await (await this.getValidScans()).reduce((sum, current) => sum + current.distance, 0);
}
}