-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurls.py
27 lines (21 loc) · 1.08 KB
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from django.urls import path
from .views import (
PostList, PostDetail,
CommentDetail,
PostComments, CreatePost, CreateComment, HideOrUnhidePostView,
ReactionToggleView,ReactionListView, PostDelete)
urlpatterns = [
# posts endpoints
path('createpost/', CreatePost.as_view(), name='create_post'),
path('posts-list/', PostList.as_view(), name='post-list'),
path('<int:pk>/', PostDetail.as_view(), name='post-detail'),
path('<int:pk>/delete/', PostDelete.as_view(), name='post-delete'),
# comments endpoints
path('createcomment/', CreateComment.as_view(), name='create_comment'),
path('<int:pk>/comments/', PostComments.as_view(), name='post_comments'),
path('comment/<int:pk>/', CommentDetail.as_view(), name='comment-detail'),
path('hide-or-unhide-post/', HideOrUnhidePostView.as_view(), name='hide-or-unhide-post'),
path('<int:pk>/toggle-reaction', ReactionToggleView.as_view(), name='toggle-reaction'),
path('<int:pk>/reactions-list', ReactionListView.as_view(), name='reactions-list'),
# In home/urls.py
]