from django.urls import path

from rest_framework.urlpatterns import format_suffix_patterns

from customer.views import CustomersViewSet

customer_list = CustomersViewSet.as_view({
    'get': 'list',
    'post': 'create'
})
customer_detail = CustomersViewSet.as_view({
    'get': 'retrieve',
    'put': 'update',
    'patch': 'partial_update',
    'delete': 'destroy'
})

urlpatterns = format_suffix_patterns([
    path('customers/', customer_list, name='customer-list'),
    path('customers/<int:pk>/', customer_detail, name='customer-detail'),
])