I am going through FreeCodeCamp’s curriculum and I can’t seem to get an exercise right. Can’t post the link to the exercise since I’m a new user. Google ‘FreeCodeCamp Exercise Tracker App’ for more info.
The tests I am failing are:
I can add an exercise to any user by posting form data userId(_id), description, duration, and optionally date to /api/exercise/add. If no date supplied it will use current date. App will return the user object with the exercise fields added.
I can retrieve a full exercise log of any user by getting /api/exercise/log with a parameter of userId(_id). App will return the user object with added array log and count (total exercise count).
However, I can both apparently update users (with new exercises) and retrieve them from the database.
I think the error is in the lines 75-175 of my server.js file.
My glitch app: https://seed-jet-dugong.glitch.me
My glitch code: https://glitch.com/edit/#!/seed-jet-dugong
Sorry in advance if my code is not the neatest…