Skip to content

Add since/until date filtering to activities endpoint#2873

Open
AntonioObra wants to merge 2 commits intobasecamp:mainfrom
openvoid-dev:activities-api-endpoint-date-filter
Open

Add since/until date filtering to activities endpoint#2873
AntonioObra wants to merge 2 commits intobasecamp:mainfrom
openvoid-dev:activities-api-endpoint-date-filter

Conversation

@AntonioObra
Copy link
Copy Markdown

Summary

Adds since and until query parameters to the GET /:account_slug/activities endpoint so API clients can filter the activity feed by date range.

Requested in #2832.

Changes

  • app/controllers/activities_controller.rb - filter activities by since and until params
  • app/models/event.rb - add since_date and until_date scopes to Event
  • docs/api/sections/activities.md - document the new query parameters
  • test/controllers/activities_controller_test.rb - add controller tests for date filtering

Usage

GET /:account_slug/activities?since=2026-04-01
GET /:account_slug/activities?until=2026-04-21
GET /:account_slug/activities?since=2026-04-01&until=2026-04-21

Dates are ISO 8601 (YYYY-MM-DD)

Copilot AI review requested due to automatic review settings April 21, 2026 12:26
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds date-range filtering to the activities feed so API clients can request a subset of events by created_at using since/until.

Changes:

  • Add since_date / until_date scopes to Event and apply them in ActivitiesController#index.
  • Document new since and until query parameters for GET /:account_slug/activities.
  • Add controller tests covering basic date filtering scenarios.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
app/controllers/activities_controller.rb Applies since/until filters to the activities relation.
app/models/event.rb Introduces since_date / until_date scopes for created_at filtering.
docs/api/sections/activities.md Documents the new query params and expected format.
test/controllers/activities_controller_test.rb Adds tests for since, until, and combined filtering.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/models/event.rb Outdated
Comment thread test/controllers/activities_controller_test.rb Outdated
Comment thread test/controllers/activities_controller_test.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants