Hi! The lastest tests from the GET /api/users/:_id/logs endpoint keep failing. It keeps showing me a time out error.
I have tried on my end and the program returns the json in the correct structure. What can be the problem? Thanks in advance!
here’s the link to the project:
Since the date is optional for posting an exercise, what happens here when the date is undefined (in your POST exercise route)?
let date = req.body.date
//validating date
if (date) {
date = datefn.parse(date, 'yyyy-MM-dd', new Date())
if (!(date instanceof Date && !isNaN(date.valueOf()))) {
res.json('Invalid date')
return;
}
}
Try logging the date before, during, and after the conditionals.
Also, try logging the route name, inputs, and all responses from your POST exercise and GET logs route to watch what happens during the tests.