from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import KupacViewSet

# Kreiramo router i registriramo naš ViewSet
# 'r' ispred stringa označava raw string (dobra praksa za regex/putanje)
router = DefaultRouter()
router.register(r'svi', KupacViewSet, basename='kupac')

# Definiramo URL obrasce
urlpatterns = [
    # Sve rute koje router generira (npr. /api/kupci/ i /api/kupci/{id}/)
    path('', include(router.urls)),
]