olegkord / HoopHub

Node JS project for General Assembly WDI
0 stars 0 forks source link

searching certain players crashes app #40

Open steve-chen-nyc opened 8 years ago

steve-chen-nyc commented 8 years ago

if there aren't any results for yesterday's game app may crash.

olegkord commented 8 years ago

If a player didn't play in the team's most recent game, then the string returned is '', crashing the app.

Mongoose query searches for the last game based on the player's team, not the player's activity.

We need to: change the query for game stats to return 10 objects instead of 1. The program will then automatically search for the most recent game and render that data. This leaves open the possibility of the player having NO data, but then who cares about that player anyway.