Skip to content

Conversation

RandomProgramm3r
Copy link
Owner

Replaced separate views for listing and creating company promos
with a single CompanyPromoListCreateView based on ListCreateAPIView.

This simplifies the API by handling GET and POST requests for promos
at a single URL endpoint (api/business/promo).

  • Uses get_serializer_class for appropriate request methods.
  • Moved query param validation into the list method.
  • Updated urls.py to point to the new combined view.
  • Remove redundant imports in serializers.
  • Adapt promo tests to use combined list/create URL

Replaced separate views for listing and creating company promos
with a single CompanyPromoListCreateView based on ListCreateAPIView.

This simplifies the API by handling GET and POST requests for promos
at a single URL endpoint (`api/business/promo`).

- Uses get_serializer_class for appropriate request methods.
- Moved query param validation into the list method.
- Updated urls.py to point to the new combined view.
- Remove redundant imports in serializers.
Updated the test setup to reflect the merged promo endpoints.
Replaced `cls.promo_create_url` and `cls.promo_list_url` with
a single `cls.promo_list_create_url` using the reversed URL name
'api-business:promo-list-create'.
@RandomProgramm3r RandomProgramm3r merged commit 31754a4 into main Apr 29, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant