Back End Development and APIs Projects - Exercise Tracker

Tell us what’s happening:
I’ve been stuck on this problem for a few hours now, and I have no idea why. All the issues have to do with the GET /api/users/:_id/logs part of the exercise, if I do it on my end everything seems fine, but on the platform, it says it is not.
Thank you in advance for your help, thanks.

Your project link(s)

solution: boilerplate-project-exercisetracker (2) - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36

Challenge: Back End Development and APIs Projects - Exercise Tracker

Link to the challenge:

All the POST requests to /api/users/:_id/exercises are returning {"ERROR":"No user with that Id"}

All the log arrays are empty {"username":"fcc_test_16826236763","count":0,"_id":"644accbd205d7720d0e9665b","log":[]}

Log out req.body and make sure it has the properties you expect it to have.

I did what you suggested, and console out the req.body but its seem fine

{
  ':_id': '644a559029aad18fd595938a',
  description: 'Abs',
  duration: '60',
  date: '2023-05-24'
}

and also try a couple more times to add exercises and log them, and it works

{
"usernanme": "fcc_test_16825931686",
"description": "Upper Body",
"duration": 30,
"date": "Wed May 24 2023",
"_id": "644a559129aad18fd595938d"
}
{
"username": "fcc_test_16825931686",
"count": 1,
"_id": "644a559129aad18fd595938d",
"log": [
{
"_id": "644b89af339bf43be687762f",
"description": "Upper Body",
"duration": 30,
"date": "2023-05-24T00:00:00.000Z"
}
]
}

don’t know what its happening! Thanks man!

Log it out again, but this time submit it and let the tests run.

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