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,

View File

@@ -40,13 +40,6 @@ const index = {
* or middleware that are applied in order.
*/
get: {
// handlers should be a list of either controller:: or middleware:: references
// e.g. middleware::HomeLogger
// e.g. controller::Home.welcome
'/': [
'controller::Home.welcome'
],
// Get information about the user's team
'/my-team': ['controller::Teams.get_my_team'],