Finish additional tests for the backend

This commit is contained in:
2020-11-08 16:15:21 -06:00
parent 30edb2563e
commit bf5d8b18b5
4 changed files with 97 additions and 9 deletions

View File

@@ -130,8 +130,11 @@ class Player extends Model {
* @returns Promise<object>
*/
async to_api(with_stats = false) {
const current_week = await this.sports_data.current_play_week()
const stat = with_stats ? await this.points_for_week(current_week) : undefined
let stat
try {
const current_week = await this.sports_data.current_play_week()
stat = with_stats ? await this.points_for_week(current_week) : undefined
} catch (e) {}
return {
id: this.id,