Finish additional tests for the backend
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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'],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user