From 846a70c63f96a391d166cf2ce004d72646d09d8d Mon Sep 17 00:00:00 2001 From: olechrib <olechrib@stud.ntnu.no> Date: Mon, 4 Apr 2022 10:52:27 +0200 Subject: [PATCH] Refactiring users/urls.py --- backend/secfit/users/urls.py | 46 ++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/backend/secfit/users/urls.py b/backend/secfit/users/urls.py index 0458ae5..27ee5f2 100644 --- a/backend/secfit/users/urls.py +++ b/backend/secfit/users/urls.py @@ -1,16 +1,42 @@ -from django.urls import path, include +from django.urls import path from users import views -from rest_framework.urlpatterns import format_suffix_patterns urlpatterns = [ - path("api/users/", views.UserList.as_view(), name="user-list"), - path("api/users/<int:pk>/", views.UserDetail.as_view(), name="user-detail"), - path("api/profiles/<int:pk>/", views.ProfileUpdate.as_view(), name="profile-update"), - path("api/users/<str:username>/", views.UserDetail.as_view(), name="user-detail"), - path("api/offers/", views.OfferList.as_view(), name="offer-list"), - path("api/offers/<int:pk>/", views.OfferDetail.as_view(), name="offer-detail"), - path( - "api/athlete-files/", views.AthleteFileList.as_view(), name="athlete-file-list" + # Adding all the user paths in the api + path( + "api/users/", + views.UserList.as_view(), + name="user-list" + ), + path( + "api/users/<int:pk>/", + views.UserDetail.as_view(), + name="user-detail" + ), + path( + "api/profiles/<int:pk>/", + views.ProfileUpdate.as_view(), + name="profile-update" + ), + path( + "api/users/<str:username>/", + views.UserDetail.as_view(), + name="user-detail" + ), + path( + "api/offers/", + views.OfferList.as_view(), + name="offer-list" + ), + path( + "api/offers/<int:pk>/", + views.OfferDetail.as_view(), + name="offer-detail" + ), + path( + "api/athlete-files/", + views.AthleteFileList.as_view(), + name="athlete-file-list" ), path( "api/athlete-files/<int:pk>/", -- GitLab