mirror of
https://github.com/etesync/server
synced 2024-12-27 09:48:24 +00:00
CollectionItem: add support for filtering collections' main items.
This used to be the default, so it still is. It only affects the list endpoint, the rest all support withCollection anyway, because IDs are passed directly.
This commit is contained in:
parent
291ebaa3f7
commit
317c492688
@ -254,6 +254,10 @@ class CollectionItemViewSet(BaseViewSet):
|
||||
|
||||
def list(self, request, collection_uid=None):
|
||||
queryset = self.get_queryset()
|
||||
|
||||
if not self.request.query_params.get('withCollection', False):
|
||||
queryset = queryset.filter(parent__isnull=True)
|
||||
|
||||
queryset, new_stoken, done = self.filter_by_stoken_and_limit(request, queryset)
|
||||
|
||||
serializer = self.get_serializer(queryset, many=True)
|
||||
|
Loading…
Reference in New Issue
Block a user