League leader awards for hockey & football - #373
Conversation
| { | ||
| name: "League Passing Leader", | ||
| stat: "pssYds", | ||
| minValue: 2000, |
There was a problem hiding this comment.
No point in a minimum for pure counting stats... it's only needed for per game stats, but none of these are per game. All these minValues should be 0.
There was a problem hiding this comment.
This is also why it doesn't work, because the minValue checking code assumes the stats in the player objects are per game, but that's only true in BBGM.
But set it to 0 and it still fails. Why? Because the minValue checking code also assumes "gp" is present, which is not true for hockey and football.
Recommendation - get rid of minValue here, and then just skip the minValue checking code in the leagueLeaders function (the filter inside the loop) if minValue is undefined.
Or let me know if you want me to just take it from here, I'm fine either way :)
There was a problem hiding this comment.
BTW this is all happening without any TypeScript error because this part of the codebase is not properly typed (players is any[])
|
9452e7b slightly different fix than I recommended. Will deploy tomorrow probably, cause I'm about to go to sleep :) thanks! |
Hockey
Football