Ilo/apps/courses/api/urls.py
2026-05-02 20:01:30 +03:30

30 lines
1.2 KiB
Python

from django.urls import include, path
from rest_framework.routers import DefaultRouter
from .views import (
CategoryListView,
InstructorCourseViewSet,
InstructorFAQViewSet,
InstructorHighlightViewSet,
InstructorLessonViewSet,
InstructorSectionViewSet,
PublicCourseDetailView,
PublicCourseListView,
)
instructor_router = DefaultRouter()
instructor_router.register(r"courses", InstructorCourseViewSet, basename="instructor-course")
instructor_router.register(r"sections", InstructorSectionViewSet, basename="instructor-section")
instructor_router.register(r"lessons", InstructorLessonViewSet, basename="instructor-lesson")
instructor_router.register(r"highlights", InstructorHighlightViewSet, basename="instructor-highlight")
instructor_router.register(r"faqs", InstructorFAQViewSet, basename="instructor-faq")
urlpatterns = [
# public
path("categories/", CategoryListView.as_view(), name="categories"),
path("courses/", PublicCourseListView.as_view(), name="public-courses"),
path("courses/<slug:slug>/", PublicCourseDetailView.as_view(), name="public-course-detail"),
# instructor surface
path("instructor/", include((instructor_router.urls, "instructor"))),
]