-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
ref(shared-views): Remove starred view logic from get /groupsearchviews/ endpoint #89239
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
ref(shared-views): Remove starred view logic from get /groupsearchviews/ endpoint #89239
Conversation
3b5a823
to
ce8c107
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, if no query params were passed into this endpoint, it would return the user's starred views.
That default behavior has now been removed, and it defaults the query params to createdBy = "me" and sort = "-visited" if none are passed in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides removing tests that accounted for the old logic, the other changes in this file are mostly reducing boilerplate code.
For example, the BaseGSVTestCase (which creates a fixed set of test data) has been removed in favor of GroupSearchViewAPITestCase, which instead provides handy functions like create_view
and star_view
. This helps reduce all of those GroupSearchView.objects.create(...) calls that took up too much space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test class depended on the BaseGSVTestCase, and refactoring it out of this file in favor of GroupSearchViewAPITestCase turned out to be a bit more work than I expected. I will do this in a separate PR.
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #89239 +/- ##
==========================================
- Coverage 87.70% 85.30% -2.41%
==========================================
Files 10107 10107
Lines 571941 571803 -138
Branches 22474 22474
==========================================
- Hits 501613 487762 -13851
- Misses 69891 83604 +13713
Partials 437 437 |
…ws/ endpoint (#89239) depends on #89235 being deployed This PR refactors the `GET` `/group-search-views/` endpoint. Previously, it used to return a user's starred views if no query params were provided. That logic has now been removed in this PR, and it has been relocated to `GET` `/group-search-views/starred` to reduce overloading of this endpoint.
…ws/ endpoint (#89239) depends on #89235 being deployed This PR refactors the `GET` `/group-search-views/` endpoint. Previously, it used to return a user's starred views if no query params were provided. That logic has now been removed in this PR, and it has been relocated to `GET` `/group-search-views/starred` to reduce overloading of this endpoint.
depends on #89235 being deployed
This PR refactors the
GET
/group-search-views/
endpoint. Previously, it used to return a user's starred views if no query params were provided. That logic has now been removed in this PR, and it has been relocated toGET
/group-search-views/starred
to reduce overloading of this endpoint.