Looking for some help from the community.
I’m stuck on /api/exercise/add/
and /api/exercise/log/
. When I submit my Glitch URL, the last 3 cases fail. It appears to me that everything is returning as expected, so I’m hoping someone with a fresh mind can take a look and point me to the issue.
When I POST an exercise to /api/exercise/add/
, the app returns:
{
"userId":"5ed677771d2b2a1238e894e0",
"description":"swim",
"duration":"20",
"date":"Sat May 25 2019",
"username":"test1234"
}
When I POST an exercise without a date to /api/exercise/add/
, the app returns:
{
"userId":"5ed677771d2b2a1238e894e0",
"description":"swim",
"duration":"20",
"date":"Tue Jun 02 2020",
"username":"test1234"
}
When I GET the exercise log from /api/exercise/log?userId=5ed677771d2b2a1238e894e0
, the app returns:
{
"userId":"5ed677771d2b2a1238e894e0",
"username":"test1234",
"count":3,
"log":[
{
"description":"swim",
"duration":20,
"date":"Sat May 25 2019"
},
{
"description":"swim",
"duration":20,
"date":"Tue Jun 02 2020"
},
{
"description":"walk",
"duration":90,
"date":"Tue Jun 02 2020"
}]
}
When I GET the exercise log with a date range from /api/exercise/log?userId=5ed677771d2b2a1238e894e0&from=2019-5-24&to=2019-5-26
, the app returns:
{
"userId":"5ed677771d2b2a1238e894e0",
"username":"test1234",
"count":3,
"log":[
{
"description":"swim",
"duration":20,
"date":"Sat May 25 2019"
}]
}
When I GET the exercise log with a limit from /api/exercise/log? userId=5ed677771d2b2a1238e894e0&limit=20
, the app returns:
{
"userId":"5ed677771d2b2a1238e894e0",
"username":"test1234",
"count":3,
"log":[
{
"description":"swim",
"duration":20,
"date":"Sat May 25 2019"
},
{
"description":"swim",
"duration":20,
"date":"Tue Jun 02 2020"
}]
}
Glitch App linked below. Thanks in advance for looking!
Glitch: https://caramel-jumpy-timimus.glitch.me/
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36
.
Challenge: Exercise Tracker
Link to the challenge: