from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
    StateViewSet, LocalityViewSet, AreaViewSet, LocationViewSet,
    locality_datatable_test_api, areas_datatable_api, locations_datatable_api
)

router = DefaultRouter()
router.register(r'states', StateViewSet, basename='state')
router.register(r'localities', LocalityViewSet, basename='locality')
router.register(r'areas', AreaViewSet, basename='area')
router.register(r'locations', LocationViewSet, basename='location')   # <-- add this line

urlpatterns = [
    path('', include(router.urls)),
    path('localities-datatable-test/', locality_datatable_test_api, name='locality_datatable_test'),
    path('areas-datatable/', areas_datatable_api, name='areas_datatable'),
    path('locations-datatable/', locations_datatable_api, name='locations_datatable'),
]