Exercise tracker tests timed out

Hi! I’m currently working on the exercise tracker project and everything works fine. I tested every route and it gives the desired output but when submitting the link in freecodecamp, I’m getting some tests timed out (from “You can make a GET request to /api/users/:_id/logs to retrieve a full exercise log of any user.” to the last test). Here is the link to my code: boilerplate-project-exercisetracker - Replit
An additional error message I’m getting in the console of replit is: ValidationError: date: Cast to date failed for value "Invalid Date" (type string) at path "date". I tried to figure out why but without any result.

Hi

If I’m reading your code correctly, for the following test case you’re assuming that if one of these optional parameters is specified, they’ll all be specified.

You can add from , to and limit parameters to a GET /api/users/:_id/logs request

I’m pretty sure that’s not necessarily true.

I don’t know to what extent that might be contributing to your problem, but I think it’s worth looking at.

Tbh, when I read this part of ur comment:

you’re assuming that if one of these optional parameters is specified, they’ll all be specified

I think the same way. I will re-check the code because when I’m checking if the optional parameters are all specified, I’m setting just the options but not specifying which code block need to be executed. Thanks for this useful note!

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