I’m stuck on test #8
The response returned from POST /api/users/:_id/exercises will be the user object with the exercise fields added.
When I check where the problem it can be, I see things like the :_id value doesn’t appear in request’s body.
Strangely when I try it on my own if it works.
I know my solution could be better, but now I want to solve the issues that don’t let pass the tests.
I put down a link to my project. I hope someone can help me.
Thanks in advance.
Hey Gabit! I was reading your code and found the error in line 88
req.params['_id'] // you are checking params, not the body
Let me know if you have any other questions
Cool! This solved the problem.
Why can I use the request body id? Is it wrong or doesn’t work on this specific test?
Fortunately now the project can pass all the tests.
Thank you very much.
No problem! Your syntax was somewhat wrong, and I believe the test wanted you to utilise the params method instead.