✨(backend) allow filtering by documents marked as favorite
We recently allowed authenticated users to mark a document as favorite. We were lacking the possibility for users to see only the documents they marked as favorite.
This commit is contained in:
committed by
Anthony LC
parent
23f90156bf
commit
08bb64ddc1
@@ -324,10 +324,12 @@ class DocumentViewSet(
|
||||
Filtering:
|
||||
- `is_creator_me=true`: Returns documents created by the current user.
|
||||
- `is_creator_me=false`: Returns documents created by other users.
|
||||
- `is_favorite=true`: Returns documents marked as favorite by the current user
|
||||
- `is_favorite=false`: Returns documents not marked as favorite by the current user
|
||||
|
||||
Example Usage:
|
||||
- GET /api/v1.0/documents/?creator=me
|
||||
- GET /api/v1.0/documents/?creator=other
|
||||
- GET /api/v1.0/documents/?is_creator_me=true&is_favorite=true
|
||||
- GET /api/v1.0/documents/?is_creator_me=false
|
||||
"""
|
||||
|
||||
filter_backends = [filters.DjangoFilterBackend, drf_filters.OrderingFilter]
|
||||
|
||||
Reference in New Issue
Block a user