Exercise tracker project failing tests 10 through 15

What’s happening?

Hello everyone! :evergreen_tree:

I finished the exercise tracker project and I have tested every single use case for project and it seems to be working fine. However, the following tests are not being passed:

Failed tests:

  • A request to a user’s log GET /api/users/:_id/logs returns a user object with a count property representing the number of exercises that belong to that user.
  • A GET request to /api/users/:id/logs will return the user object with a log array of all the exercises added.
  • Each item in the log array that is returned from GET /api/users/:id/logs is an object that should have a description , duration , and date properties.
  • The description property of any object in the log array that is returned from GET /api/users/:id/logs should be a string.
  • The duration property of any object in the log array that is returned from GET /api/users/:id/logs should be a number.
  • 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.

Can you help me find my mistake(s)? I checked everything and it seems ok.

Link to the project:
https://replit.com/@lambolead/boilerplate-project-exercisetracker#server.js

Browser info:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36 Edg/94.0.992.31

Challenge: Exercise Tracker

Link to the challenge:

Hi, I was facing same problem when I tried to pass this .

I solved this by Inspecting the request object sensed by the freecodecamp and saw the response back .

if you’re familiar with Google developer tool or what ever browser’s tool you’re using, do these steps :

1 - before you submit your project in FCC website, open the dev tools.

2 - clear everything by typing console.clear() in the console tab.

3 - go to the network tab .

4 - submit your project

now you should see the request that Fcc is sending to the server to test your responses.

click on those requests and go to the response or preview tab if get it right.

and do some checks between your responses and the FCC project responses.

sorry for this long explanation

1 Like

Hello @medaminefh. Thank you for your response, I am definitely gonna check that out before I go crazy

It worked! By analysing the network activity (specifically, the form data for each POST request and its response) I figured out that there was some problem with handling empty date fields.
I cannot thank you enough. You deserve this bouquet :bouquet:

1 Like

Happy for you :grinning:, and thanks for this gift

is the one causing errors are CORS? if it’s true, how do you solve it?