Exercise Tracker Microservice : Unable to pass test 15

Tell us what’s happening:
I am unable to pass just a single test in the Exercise Tracker project.

Below is the test’s assertion:
The date property of any object in the log array that is returned from GET /api/users/:id/logs should be a string… Use the dateString format of the Date API.

I need help because I converted the dates to dateStrings.

Your project link(s)

solution: https://replit.com/@chucks/boilerplate-project-exercisetracker

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36

Challenge: Exercise Tracker

Link to the challenge:

Welcome there,

This is the issue:

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

What about when the date is not given? Why would the date === ''?

Hope this helps

Thanks a lot. I didn’t check for the case when the req.body.date === undefined

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