|
@@ -1,10 +1,23 @@
|
|
|
-from django.urls import path
|
|
|
+from django.urls import path, include
|
|
|
|
|
|
from tickets.api import views as apiviews
|
|
|
from tickets.views import *
|
|
|
|
|
|
app_name = "tickets"
|
|
|
|
|
|
+api_v1_patterns = [
|
|
|
+ path("ticket_list/", apiviews.TicketListListAPIView.as_view()),
|
|
|
+ path("ticket_list/my/", apiviews.TicketListDetailAPIView.as_view(), {"my": True}),
|
|
|
+ path("ticket_list/<int:pk>", apiviews.TicketListDetailAPIView.as_view()),
|
|
|
+ path("ticket/", apiviews.TicketCreateAPIView.as_view()),
|
|
|
+ path("ticket/<int:pk>", apiviews.TicketDetailAPIView.as_view()),
|
|
|
+ path("ticket/<int:pk>/status", apiviews.TicketStatusAPIView.as_view()),
|
|
|
+]
|
|
|
+
|
|
|
+api_v2_patterns = [
|
|
|
+
|
|
|
+]
|
|
|
+
|
|
|
urlpatterns = [
|
|
|
path("", TicketListView.as_view(), name="ticket_list_list"),
|
|
|
path("search/", search, name="search"),
|
|
@@ -19,11 +32,7 @@ urlpatterns = [
|
|
|
path("ticket/<int:pk>/delete", TicketDeleteView.as_view(), name="ticket_delete"),
|
|
|
path("attachment/remove/<int:attachment_id>/", remove_attachment, name="remove_attachment"),
|
|
|
|
|
|
- # API
|
|
|
- path("api/ticket_list/", apiviews.TicketListListAPIView.as_view()),
|
|
|
- path("api/ticket_list/my/", apiviews.TicketListDetailAPIView.as_view(), {"my": True}),
|
|
|
- path("api/ticket_list/<int:pk>", apiviews.TicketListDetailAPIView.as_view()),
|
|
|
- path("api/ticket/", apiviews.TicketCreateAPIView.as_view()),
|
|
|
- path("api/ticket/<int:pk>", apiviews.TicketDetailAPIView.as_view()),
|
|
|
- path("api/ticket/<int:pk>/status", apiviews.TicketStatusAPIView.as_view()),
|
|
|
+ path("api/", include(api_v1_patterns)),
|
|
|
+ # TODO: Рассмотреть возможность использования второго API, когда будет готово
|
|
|
+ # path("api/v2/", include(api_v2_patterns)),
|
|
|
]
|