From d22350faf8e17632cd04c2217afd7eb5d6d371cd Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 7 Feb 2020 20:51:25 +0100 Subject: [PATCH] /note/user, /note/club, /note/special => /note --- apps/api/activity/urls.py | 6 +++--- apps/api/members/urls.py | 8 ++++---- apps/api/note/urls.py | 11 ++++------- apps/api/urls.py | 6 +++--- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/apps/api/activity/urls.py b/apps/api/activity/urls.py index ca0fab43..56665730 100644 --- a/apps/api/activity/urls.py +++ b/apps/api/activity/urls.py @@ -9,6 +9,6 @@ def register_activity_urls(router, path): """ Configure router for Activity REST API. """ - router.register(path + r'activity', ActivityViewSet) - router.register(path + r'type', ActivityTypeViewSet) - router.register(path + r'guest', GuestViewSet) + router.register(path + '/activity', ActivityViewSet) + router.register(path + '/type', ActivityTypeViewSet) + router.register(path + '/guest', GuestViewSet) diff --git a/apps/api/members/urls.py b/apps/api/members/urls.py index ffce1cbd..f60465c0 100644 --- a/apps/api/members/urls.py +++ b/apps/api/members/urls.py @@ -9,7 +9,7 @@ def register_members_urls(router, path): """ Configure router for Member REST API. """ - router.register(path + r'profile', ProfileViewSet) - router.register(path + r'club', ClubViewSet) - router.register(path + r'role', RoleViewSet) - router.register(path + r'membership', MembershipViewSet) + router.register(path + '/profile', ProfileViewSet) + router.register(path + '/club', ClubViewSet) + router.register(path + '/role', RoleViewSet) + router.register(path + '/membership', MembershipViewSet) diff --git a/apps/api/note/urls.py b/apps/api/note/urls.py index da12760d..2bc56aa6 100644 --- a/apps/api/note/urls.py +++ b/apps/api/note/urls.py @@ -10,11 +10,8 @@ def register_note_urls(router, path): """ Configure router for Note REST API. """ - router.register(path + r'note', NotePolymorphicViewSet) - router.register(path + r'club', NoteClubViewSet) - router.register(path + r'user', NoteUserViewSet) - router.register(path + r'special', NoteSpecialViewSet) + router.register(path + '', NotePolymorphicViewSet) - router.register(path + r'transaction/transaction', TransactionViewSet) - router.register(path + r'transaction/template', TransactionTemplateViewSet) - router.register(path + r'transaction/membership', MembershipTransactionViewSet) + router.register(path + '/transaction/transaction', TransactionViewSet) + router.register(path + '/transaction/template', TransactionTemplateViewSet) + router.register(path + '/transaction/membership', MembershipTransactionViewSet) diff --git a/apps/api/urls.py b/apps/api/urls.py index d272fc8d..03db1382 100644 --- a/apps/api/urls.py +++ b/apps/api/urls.py @@ -32,13 +32,13 @@ router = routers.DefaultRouter() router.register(r'users', UserViewSet) # Routers for members app -register_members_urls(router, r'members/') +register_members_urls(router, r'members') # Routers for activity app -register_activity_urls(router, r'activity/') +register_activity_urls(router, r'activity') # Routers for note app -register_note_urls(router, r'note/') +register_note_urls(router, r'note') # Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browsable API.