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

from .api import (
    RoleViewSet,
    PermissionViewSet,
    UserRelationViewSet,
    PageViewSet,
    UpdatePageAccessViewSet
)

router = DefaultRouter()  # set router

# register route to router
router.register(r'role', RoleViewSet, basename='role')
router.register(r'permission', PermissionViewSet, basename='permission')
router.register(r'user-relations', UserRelationViewSet, basename='organization-role')
router.register(r'page', PageViewSet, basename='page')
router.register(r'update_access', UpdatePageAccessViewSet, basename='update_page')

urlpatterns = [
    path('', include(router.urls))
]
