Back End Development and APIs Projects - Exercise Tracker

I am using the toDateString function still I can’t pass the test:
I can’t pass the second last test, I get: “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’ve been checking other posts and I found that sometimes can be a timezone issue, but I’ve changed the timezone in my computer and also tried an extension to change the browser’s timezone, and still is not working, I haven’t tried it at different hours though. If the problem is the timezone please tell me which specific timezone should I use.

** index.js - boilerplate-project-exercisetracker - Replit**

solution: boilerplate-project-exercisetracker - Replit

Your browser information:

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

Challenge: Back End Development and APIs Projects - Exercise Tracker

Link to the challenge:

Not sure why you aren’t failing the POST test with the optional date but you really should be.

Open the network tab in the dev tools and submit. Now look at the response object for the logs request.

Now go to the third exercises request and look at the response object. Now look at the payload tab, do you see something missing?

I don’t understand what you mean , sorry

Did you do what I said to do? Being able to inspect the request/response in the browser is vital.

You are not handling the POST with no date in the payload.

I think your answer did help, I submitted without a date and I got “invalid date” on my object, so I adjusted the code so I won’t get an invalid date in case no date is submitted

That’s good.

As I said, you really should have been failing this test.

You can POST to /api/users/:_id/exercises with form data description , duration , and optionally date . If no date is supplied, the current date will be used.

I didn’t look at why the test didn’t fail.

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