Exercise Tracker Failing test 5 & 6

I have been working on the the Exercise Tracker project for a bit now, and I’ve gotten test 1-4 & 7 to pass, but the test in between are failing, and I do not know the cause. I believe the lines of code most pertinent to my issue begin on line 127. Any and all help would be greatly appreciated.

Code: https://replit.com/@caryaharper/boilerplate-project-exercisetracker#server.js

solution: https://boilerplate-project-exercisetracker.caryaharper.repl.co

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36.

Challenge: Exercise Tracker

Link to the challenge:

1 Like

It’s the line 74:

let date = req.body.date === "" ? new Date() : new Date(req.body.date);

If date is not supplied it’ll be undefined and not an empty string.
So you should change it to:

let date = !req.body.date ? new Date() : new Date(req.body.date);

That was it, thank you so much!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.