Back End Development and APIs Projects - Exercise Tracker - last challenge *HELP*

Tell us what’s happening:
Im stuck on the last challenge. I tried testing it on my own and it returns the expected results. i dont know what am i doing wrong here. Please help me. I

Your project link(s)

solution: boilerplate-project-exercisetracker - Replit

githubLink: GitHub - ALDIRON-lols/freeCodeCamp_Excercise_Tracker: An excercise tracking web page that will allow user to add him/herself and add excercises as well as their time and duration.

Your browser information:

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

Challenge: Back End Development and APIs Projects - Exercise Tracker

Does it work if you use the link to the live project?

In this case that would be:

https://boilerplate-project-exercisetracker--alironlols.repl.co/

For the last test, you are returning an empty log array.

I believe your limit filter is causing the data returned to not contain the two needed objects for the to/from condition inside the map. So they work separately (to/from or limit) but not both at the same time (to/from and limit).

yes it does. i am using the link that you mentioned.

I updated the code a little. i removed the limit filter and added it in the to/from condition, making it (to/from && limit). And i tried removing the null array condition. I only placed it there to return an empty array incase if none pass the condition as otherwise the map returns an array full of nulls. You can check the updated repository.
Nevertheless, it still wont let me pass it.

i have similar problem, exactly on the last test about from, to and limit request queries.
it returns the same as the example project does, code works fine. do u have any solution about this?
thanks.
here is my replit project link: boilerplate-project-exercisetracker - Replit

try removing the to and from dates from the response. idk, im stuck on this same one.

It is three separate tests combined into one requirement.

  1. to/from /logs?from=1989-12-31&to=1990-01-04

  2. limit /logs?limit=1

  3. to/from and limit /logs?from=1990-01-02&to=1990-01-04&limit=1

Your code needs to handle all three cases.


The tests if you are curious:

https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md


Also, your limit response now contains a null value as the second array element.

{
    "_id": "64f222d55a61ab1f77eb4593",
    "username": "fcc_test_16935902278",
    "count": 2,
    "log": [
        {
            "description": "test",
            "duration": 60,
            "date": "Mon Jan 01 1990"
        },
        null
    ]
}

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