Skip to content

Commit

Permalink
refactor(locations): add new count fields in API ordering settings. ref
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Sep 27, 2024
1 parent a984cfa commit b02c480
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion open_prices/api/locations/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class LocationViewSet(
serializer_class = LocationSerializer
filter_backends = [DjangoFilterBackend, filters.OrderingFilter]
filterset_class = LocationFilter
ordering_fields = ["price_count", "created"]
ordering_fields = Location.COUNT_FIELDS + ["created"]
ordering = ["created"]

def get_serializer_class(self):
Expand Down
8 changes: 1 addition & 7 deletions open_prices/api/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,5 @@ class UserViewSet(mixins.ListModelMixin, viewsets.GenericViewSet):
serializer_class = UserSerializer
filter_backends = [DjangoFilterBackend, filters.OrderingFilter]
filterset_class = UserFilter
ordering_fields = [
"user_id",
"price_count",
"location_count",
"product_count",
"proof_count",
]
ordering_fields = User.SERIALIZED_FIELDS
ordering = ["user_id"]

0 comments on commit b02c480

Please sign in to comment.