Skip to content

Add get_groups_by_status view function with pagination#101

Open
WuXieSec wants to merge 1 commit intosorosave-protocol:mainfrom
WuXieSec:feat/get-groups-by-status
Open

Add get_groups_by_status view function with pagination#101
WuXieSec wants to merge 1 commit intosorosave-protocol:mainfrom
WuXieSec:feat/get-groups-by-status

Conversation

@WuXieSec
Copy link
Copy Markdown

This PR adds a view function to query groups filtered by their current status, as requested in #65.

Changes:

  • Add get_groups_by_status(status, offset, limit) function
  • Returns a list of group IDs matching the given status
  • Supports pagination with offset and limit parameters
  • Includes test coverage for status filtering and pagination

Use cases:

  • Frontend can efficiently list all "Forming" groups available to join
  • Display "Active" groups separately from "Completed" ones
  • Paginate large result sets to avoid performance issues

Implementation:
Iterates through all groups (1 to group_counter), filters by status, and applies pagination. This approach works well for the expected scale of groups.

Closes #65

Changes:
- Add get_groups_by_status(status, offset, limit) function
- Returns list of group IDs matching the given status
- Supports pagination with offset and limit parameters
- Add test coverage for status filtering and pagination

This allows frontend to efficiently query groups by their
current lifecycle status (Forming, Active, Completed, etc.)

Closes sorosave-protocol#65
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.

Add get_group_by_status view function

1 participant