feat(api): implement endpoints to products, customer and sales.
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
from django.urls import path
|
||||
from django.urls import path, include
|
||||
from rest_framework.routers import DefaultRouter
|
||||
|
||||
from . import views
|
||||
from . import api_views
|
||||
|
||||
app_name = 'don_confiao'
|
||||
|
||||
router = DefaultRouter()
|
||||
router.register(r'sales', api_views.SaleView, basename='sale')
|
||||
router.register(r'customers', api_views.CustomerView, basename='customer')
|
||||
router.register(r'products', api_views.ProductView, basename='product')
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path("", views.index, name="wellcome"),
|
||||
path("comprar", views.buy, name="buy"),
|
||||
@@ -14,5 +22,6 @@ urlpatterns = [
|
||||
path("cuadrar_tarro", views.reconciliate_jar, name="reconciliate_jar"),
|
||||
path("cuadres", views.reconciliate_jar, name="reconciliations"),
|
||||
path("resumen_compra/<int:id>", views.purchase_summary, name="purchase_summary"),
|
||||
path('api/sales/', api_views.SaleViewSet.as_view({'post': 'create'}), name='sale-create')
|
||||
path('api/sales_with_lines/', api_views.SaleWithLinesViewSet.as_view({'post': 'create'}), name='sale-create'),
|
||||
path('api/', include(router.urls)),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user