Tell us what’s happening:
Describe your issue in detail here.
Hello, I have completed this challenge and it works perfectly when I test it thru the form, but when the automated scripts run, it fails at posting the exercise data. Can you please help…
I do not understand why the test script is failing.
Any help in this direction is much appreciated.
Thank you.
For the previous problem reported, I have tried and solved this problem myself - one line of code in app.post(‘/api/users/:_id/exercises’, function(req, res) was causing the problem.
const id = req.body[‘:_id’];
While this was working locally, for some reason this did not work with the test scripts. I have changed this line of code to
const id = req.params[‘_id’]
and it worked. I was able to get past the scripts for app.post(‘/api/users/:_id/exercises’…