-
-
Notifications
You must be signed in to change notification settings - Fork 842
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
Groups GET API endpoint ignores parameters #2492
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. |
Hello, is this issue open for PRs? I'd like to work on it. If so, please confirm that as part of it, the following needs to be implemented:
Thanks! |
Absolutely, thank you for expressing interest! We'd probably want to follow a similar pattern to the One potential challenge is pagination, as that would require a lot of frontend changes. That's something we want to eventually move towards, and closing this issue would pave the road for that. In the meantime, if you hardcode a negative limit as the default (probably with the ability to override), that should disable limiting: https://github.com/flarum/core/blob/d2c953b7ee7c2644ab33314f9966da800b08d1a6/src/Query/ApplyQueryParametersTrait.php#L58-L67 |
Hello, I have created a draft PR #3084, so that you can have a preliminary look into my work. As of right now, I only implemented dedicated I will push changes related to filtering in the upcoming days, once I will understand how it is implemented for other entities. |
It looks great to me, thank you very much for the contribution!
Please don't hesitate to reach out here, on discuss.flarum.org, or on our Discord if you have any question! Thanks again! |
…oup model Included in flarum#2492
Hey, I pushed filter & pagination changes! After thinking about it, I decided to leave out searcher, as using same gambits as in filtering wouldn't make sense and implementing full-text searcher that would require migration seemed like an overkill for groups, but if you think otherwise, let me know - if this is okay though, I will mark PR as ready for review. Also, some other notes:
PS: Sorry that it took so long, I didn't have much free time & I spent extra time digging deeper into the code, nice job with the architecture, love it 😍👍. |
Left a comment on the PR, thank you so much for your hard work on this! |
Fixes flarum#2492 Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Fixes #2492 * Added api/groups/{id} endpoint for retrieving a single group by its id * Fixed GroupRepository incorrectly opening query to User instead of Group model * Added filtering & paging abilities to GET api/groups endpoint * Added test for sorting for GET api/groups endpoint Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Bug Report
Current Behavior
No matter the GET params,
/api/groups
always return all groups. None of the usual parameters likefilter[q]
andpage
work. There is also no way to get one group by its ID (GET /groups/{id}
doesn't exist like it does for users and discussions).Steps to Reproduce
The text was updated successfully, but these errors were encountered: