diff --git a/src/open_producten/producttypes/tests/api/test_product_type_price.py b/src/open_producten/producttypes/tests/api/test_product_type_price.py index 3624659..d513b29 100644 --- a/src/open_producten/producttypes/tests/api/test_product_type_price.py +++ b/src/open_producten/producttypes/tests/api/test_product_type_price.py @@ -344,7 +344,7 @@ def test_delete_price(self): self.assertEqual(PriceOption.objects.count(), 0) def test_get_current_prices_when_product_type_has_no_prices(self): - response = self.client.get("/api/v1/producttypes/current_prices/") + response = self.client.get("/api/v1/producttypes/current-prices/") self.assertEqual(response.status_code, 200) self.assertEqual( response.data, @@ -364,7 +364,7 @@ def test_get_current_prices_when_product_type_only_has_price_in_future(self): product_type=self.product_type, valid_from=datetime.date(2024, 2, 2) ) - response = self.client.get("/api/v1/producttypes/current_prices/") + response = self.client.get("/api/v1/producttypes/current-prices/") self.assertEqual(response.status_code, 200) self.assertEqual( @@ -388,7 +388,7 @@ def test_get_current_prices_when_product_type_has_current_price(self): option = PriceOptionFactory.create(price=price) - response = self.client.get("/api/v1/producttypes/current_prices/") + response = self.client.get("/api/v1/producttypes/current-prices/") self.assertEqual(response.status_code, 200) self.assertEqual( diff --git a/src/open_producten/producttypes/views.py b/src/open_producten/producttypes/views.py index e10f9d1..df249f0 100644 --- a/src/open_producten/producttypes/views.py +++ b/src/open_producten/producttypes/views.py @@ -36,7 +36,11 @@ class ProductTypeViewSet(ModelViewSet): serializer_class = ProductTypeSerializer lookup_url_kwarg = "id" - @action(detail=False, serializer_class=ProductTypeCurrentPriceSerializer) + @action( + detail=False, + serializer_class=ProductTypeCurrentPriceSerializer, + url_path="current-prices", + ) def current_prices(self, request): product_types = ProductType.objects.all() serializer = ProductTypeCurrentPriceSerializer(product_types, many=True) diff --git a/src/openapi.yaml b/src/openapi.yaml index 08d6e25..a69ee97 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -1357,7 +1357,7 @@ paths: responses: '204': description: No response body - /api/v1/producttypes/current_prices/: + /api/v1/producttypes/current-prices/: get: operationId: producttypes_current_prices_retrieve tags: