Closed schmitty890 closed 4 years ago
@Habernet , i know we talked about this tonight, feel free to push up an async/await solution, i'd love to see one. i found a solution with promise.all that seemed to work to get the await out of the for loop
closing this for now as its fixed, but feel free to push up an asyc await solution if its better or a different variation or what not
We should not be using await inside of a for loop in the doTeamsHaveGamesToday function in the controllers/subscribe.js file. We have disabled the eslint rule around this issue as it is still working for what we need it to do, but there is a better way to code this.
We send the teamID of our subscribed team to the nhl api to see if the team is playing or not, we get a Boolean back. This async/await is not being used correctly, however works for its current purpose.