My last test case is not passing in the backend certification's exercise tracker project

Tell us what’s happening:
Describe your issue in detail here.
I have done every thing to fix this issue but for some reason , My project is not able to pass the last test case . The code logic is ok as far as I think , I tried many methods but still it does not work please if anyone can help me , It would be appreciated.

All the test cases are working and only the third route →
api/users/:id/logs?limit&from& …
is not working I have included the replit link

Your project link(s)


Your browser information:

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

Challenge: Exercise Tracker

Link to the challenge:

I just tested your project and it passed all the tests.

Check the network tab in the dev tools to see if there is anything funky going on (blocking 404 or 502 etc.).

Thank you for your kind reply . I tested it again and it’s still failing the last test case. I have checked the network tab and I don’t see any 502 or 404 , all things look ok to me

Not sure why that is.

I would suggest you look at the response for the last 3 GET and make sure they look correct. You can read the tests and see what they expect the response to look like and compare that to what you are seeing in the browser when submitting.

The only thing I can think of is that the Date might be wrong for you somehow.

Well I did as you said , the response is correct and there is no problem in my response. And there is no problem in date because in the last test, the dates used are static.

I tried to submit my friends project from my ID and it was accepted but when i took his code and pasted it in my file and tried to submit that project it was rejected and only last test failed. I did this to check whether there was problem in replit but this is still didn’t work

Your server cannot handle /api/users/:id/logs but without from and to queries because default values for them are not specified, try hitting your API without from or to they will become Invalid Date in your server, and your server to db queries will also become invalid.

Also, if you try with correct date input for from and to (for example 2000-12-01 and 2022-12-01), it still return exercises outside that date (in my test it still return logs of exercises in 1990, test case from fcc). I think your db queries is not correct yet. You can test your code (try it using Insomnia or Postman, these are tools to hit your server directly) and check whether it responses as requested or not, check the json check the format in its fields.

Here are screenshots from Insomnia hitting your server.

Or you can also hit it directly via browser and check the response, hope this help.

1 Like

@Subrashi316 You can try using Glitch or coding it locally.

As I said, the project is passing for me.

1 Like

Thanks for reply but this problem was not really causing the issue , I fixed it and it still was not working . See the problem was in my replit ,So I tried running the same project locally and it worked

Thanks for reply, I tried it running locally and it worked so I think there is some problem with my replit server

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