Back End Development and APIs Projects - Exercise Tracker

Hi, I am failing several tests related to creating exercises and logs of the Exercise Tracker project.

My app is hosted at: https://exercise-tracker-expressjs.herokuapp.com/

My responses, to API requests, match the FreeCodeCamp demo: https://exercise-tracker.freecodecamp.rocks/

I need urgent help. You can try matching the responses of my project with those of the FCC demo. I will be grateful for any kind of assistance.

Challenge: Back End Development and APIs Projects - Exercise Tracker

Link to the challenge:

Snapshots: Errors, FCC demo vs My Project

Create Exercise:


Logs:

It says I don’t have the “count” property in the response but it is there.


Can you post your repo?

I don’t see the correct responses. All the log arrays are empty and the POST to /api/users/:_id/exercises doesn’t return the correct object.

Request URL: https://exercise-tracker-expressjs.herokuapp.com/api/users/63024e8db319deb5963645fb/exercises
{"success":false,"msg":"Incomplete details"}
Request URL: https://exercise-tracker-expressjs.herokuapp.com/api/users/63024e8fb319deb596364603/logs
{"_id":"63024e8fb319deb596364603","username":"fcc_test_16610955657","count":0,"log":[]}

Hi, Lasse, thanks for the response. Can you please tell me what data did you supply to it?

Here is the replit repo: https://boilerplate-project-exercisetracker.mainlycricket.repl.co

I’ve found that the _id is not a mandatory field while creating an exercise.

While the FCC demo provides an error (with POST request) in that case, I am failing to achieve it. I am redirected to another page with the ’ GET’ request. Please help me in finding a fix.

image

I just submitted it and looked at the network tab, so whatever the tests supply.


Did you try using the paramId? Look at the request URL and the payload in the browser dev tools

Request URL: https://boilerplate-project-exercisetracker.lasjorg.repl.co/api/users/6302618392658858c26be721/exercises
Payload: description: test
duration: 60
date: 1990-01-01

Please use this replit repo: https://boilerplate-project-exercisetracker.mainlycricket.repl.co

Source Code: boilerplate-project-exercisetracker - Nix (beta) Repl - Replit

I was making some changes to the heroku app and testing it in the local machine, so there might be some sync issues.


I’d suggest you submit the URL and look at the request/payload and the response there. Using the form and the automated tests have some differences. For one, the tests do not use the form.

Thanks for your help, Lasse. I handled the invalid inputs, fixed some status codes and passed all the tests through my Heroku app.