Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Show additional events" button always fetches 10 more days, regardless of the previously requested range #760

Open
carrythebanner opened this issue Jun 28, 2024 · 0 comments · May be fixed by #771

Comments

@carrythebanner
Copy link
Collaborator

carrythebanner commented Jun 28, 2024

Fetch any date range other than the default 10 day range, e.g. https://www.shift2bikes.org/calendar/?startdate=2024-06-28&enddate=2024-06-28 (1 day). When you press "Show additional events" it always loads 10 more days, ignoring the size of your previously requested range.

Instead, we should use the same range length for subsequent requests. Note that the pagination.next URL in the events API response does already do this, but the frontend isn't consuming that value. e.g. Response for https://www.shift2bikes.org/api/events.php?startdate=2024-06-28&enddate=2024-06-28:

{
  "events": [
    …
  ],
  "pagination": {
    "start": "2024-06-28",
    "end": "2024-06-28",
    "range": 0,
    "events": 13,
    "next": "https://shift2bikes.org/api/events.php?startdate=2024-06-29&enddate=2024-06-29"
  }
}

(For "range": 0, see #567.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant