Exercise tracker - Test#4 keeps failing [Solved]

I’ve been trying to figure this out for 3 days already. I even took a look at the example project source code, and even tho mine is messier, the outputs are exactly the same.

The test that is failing is:

I can add an exercise to any user by posting form data userId(_id), description, duration, and optionally date to /api/exercise/add. If no date supplied it will use current date. App will return the user object with the exercise fields added.

I’m sure that I’m missing something, but I can’t see what it is.

I’m really close to giving up, this is really frustrating.

I compared the output of the example app with mine and as you can see, it’s exactly the same:

Example project:
{
    "_id": "5f15a9d15ae2df00867a1df9",
    "username": "fcc_test_15952551484",
    "date": "Mon Jul 20 2020",
    "duration": 60,
    "description": "test"
}
My app: 
{
    "_id": "5f15ab57938bc50017ec3958",
    "username": "fcc_test_15952502300",
    "date": "Mon Jul 20 2020",
    "duration": 60,
    "description": "test"
}

You can see my code in this repo: https://github.com/franprince/exercise-app
And here is the link to my deployed app: https://fran-app.herokuapp.com/

Challenge: Exercise Tracker

Link to the challenge:

Hello!

First of all, welcome to the forum :partying_face:! We hope you learn a lot.

I haven’t checked your entire code yet… just wanted to ask you to remove the .env files from your commits, since it contains sensitive data (at least it usually does). Create a .gitignore file add the .env file (the .gitignore file has to be commited).

Hi! Thank you for the headsup, I’ve edited the repo.

1 Like

Well, I finally figured it out. I was sending the Exercise ID instead of the User ID in the response. I knew I was missing something.

1 Like