From 79407c59bfb7f7d11027f801e69d2e26dcda51bd Mon Sep 17 00:00:00 2001 From: moonlitgrace Date: Wed, 4 Dec 2024 17:27:35 +0530 Subject: [PATCH] refactor: api router endpoints to plural --- backend/apps/quiblet/api/urls.py | 4 +--- backend/apps/user/api/urls.py | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/backend/apps/quiblet/api/urls.py b/backend/apps/quiblet/api/urls.py index 8c05ece..67ee3f0 100644 --- a/backend/apps/quiblet/api/urls.py +++ b/backend/apps/quiblet/api/urls.py @@ -2,10 +2,8 @@ from .viewsets import QuibletViewSet -app_name = 'quiblet_api_v1' - router = DefaultRouter() -router.register('', QuibletViewSet, basename='quiblet') +router.register(r'', QuibletViewSet) urlpatterns = [] urlpatterns += router.urls diff --git a/backend/apps/user/api/urls.py b/backend/apps/user/api/urls.py index b6f43a8..1d2e874 100644 --- a/backend/apps/user/api/urls.py +++ b/backend/apps/user/api/urls.py @@ -6,10 +6,10 @@ # main router for users/ and profiles/ router = DefaultRouter() -router.register('', viewsets.UserViewSet, basename='user') -router.register('profile', viewsets.ProfileViewSet, basename='profile') +router.register(r'', viewsets.UserViewSet) +router.register(r'profiles', viewsets.ProfileViewSet) # profiles of requested user -router.register('me/profiles', viewsets.MyProfilesViewSet, basename='my-profiles') +router.register(r'me/profiles', viewsets.MyProfilesViewSet, basename='me-profile') # fmt: off urlpatterns = [