Last 8 Problems in Exercise Tracker

Link to project

I’ve been stuck on the last 8 test cases for the last 6 hours now, and I’m not really sure what’s happening? These are all related to “/api/users/:id/logs”

You’re going to have to do some basic debugging by logging to the server console your route inputs and your route responses and then look at the errors in the browser console when you run the tests. Right now you have validation errors on the server from the exercise model and errors on the browser console when your server does not transmit the exercise logs. Lots of these errors are caused by your POST exercise route which assumes it will always be provided a date despite instructions in the spec about default dates.

My advice is to log the inputs and responses on each route and compare them with the spec and make sure you implement the behaviors described by the specs.

I’ve been doing that, but one question I have is why, when I make a POST request, code from the GET request gets executed? I have a commented out console.log() in the GET request that displays a message, but consoles that message when I make a POST request.

Thank you for your reply!

I am seeing the message, perhaps I am doing something wrong? I simply insert a username in Create a New User box, and when I submit two things happen:

  1. My entire database gets logged out (even though I just want one entry to be posted)
  2. ‘This will log out even though I’m doing a POST request’ is displayed on the console.

Thank you, will this affect the tests?

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