Back End Development and APIs Projects - Exercise Tracker

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…

Here are some screenshots - hope it helps -

The replit console shows this -


The mongodb database shows

Your project link(s)

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/ Safari/537.36

Challenge: Back End Development and APIs Projects - Exercise Tracker

Link to the challenge:

Please help… I have been able to get past the scripts for post and am no stuck with the last test…

from , to and limit parameters to a GET /api/users/:_id/logs request”

While the status logs show everything has worked -

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‘/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‘/api/users/:_id/exercises’…

Update… solved this…count was not calculated properly for certain conditions - corrected this. Now are tests are passing.

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