"""Webapp urls."""

from django.urls import path, re_path, include
from rest_framework import routers
from rest_framework_simplejwt.views import (
    TokenObtainPairView,
    TokenRefreshView,
    TokenVerifyView,
)
from webapp.views import *


class APIRouter(routers.DefaultRouter):
    APIRootView = RootView


router = APIRouter()
router.register(r"events", EventViewSet)
router.register(r"signupForm", SignupFormViewSet)
router.register(r"signup", SignupViewSet)
router.register(r"feed", FeedViewSet)
router.register(r"questions", SavedQuestionsViewSet)
router.register(r"tags", TagsViewSet)
router.register(r"jobads", JobAdViewSet)

urlpatterns = [
    re_path(r"^api/", include(router.urls)),
    path(r"api/token/", TokenObtainPairView.as_view(), name="token_obtain_pair"),
    path(r"api/token/verify/", TokenVerifyView.as_view(), name="token_verify"),
    path(r"api/token/refresh/", TokenRefreshView.as_view(), name="token_refresh"),
    re_path(r"^jwt_nginx", nginx_jwt_resp),
]
