BioDrop: [BUG] API should reduce the data returned

Description

On the user’s statistics page, we are retrieving all their daily stats from the API but only displaying the last 30 days pages/account/statistics.js

We should add a query parameter to the API so that we only retrieve the requested data api/account/statistics.js, default to 30 days

Screenshots

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

The limit could always be added in another issue/pull request - it has no limit now, so we are still moving forwards and making improvements by adding a default of 30

hey @Dun-sin , yes you are correct πŸ‘

Limit the data gotten from Mongodb for profile clicks and link clicks, to 30 days using the query on findOne?

Currently it is done in the UI here https://github.com/EddieHubCommunity/BioDrop/blob/42a9e1fd6d653a5b9df63971209f575bcd398b61/pages/account/statistics.js#L88 but we should be able to remove this limit as the backend API function should only return 30 by default, note is it not a findOne but a find https://github.com/EddieHubCommunity/BioDrop/blob/42a9e1fd6d653a5b9df63971209f575bcd398b61/pages/api/account/statistics.js#L39

By default it should be 30 days but allow the option to pick any other number of days? The limit here should be what? 365 days?

Yes πŸ‘ I was thinking to have no limit, but if you are able to add a max limit of 365, that would be great πŸ’―

Also be aware of the changes in this PR in the UI https://github.com/EddieHubCommunity/BioDrop/pull/8580