Open aidanbell opened 4 years ago
Edit:
toLowerCase()
on your req.body
before passing it into the rest of your function. This is also a good usecase for error handling. After that though, everything works out fine. Your adding and deleting players is successful.
I know that you hit a lot of issues in the development of this project, so well done getting it all done by the deadline! Here are my comments/notes/issues:
player
controller, but all you had was anindex
controller with one function in it. When I then checked yourindex
router, not only was every player controller function in there, but also all of your OAuth controller functions. I know that in the lessons, we built most of our OAuth functions within the router, but we still separated them into ausers
router. Remember, you should separate routes that handle similar things to their own routers (players, team, users, etc), and then match those to their own controller. This makes troubleshooting and adding functionality a breeze.index
router that are identical. We want to avoid this whenever possible, because having identical routes can confuse our server, and lead to very unexpected results. https://github.com/AhmedJamal93/basketball-api/blob/a524eb6c5b9c5164e7984cd7626e3fa68ea305fa/routes/index.js#L48-L66jsondom
) works, you could have probably saved a lot of time by converting it to JSON, and operating on it that way. The other (probably quicker) way to do it, would be to seed all of that data into your database. Database filters/searches are always the quickest and easiest way to sort through data (that's what they're made for!)