feat(users): add /me/ endpoint for detail/update/delete user object

This commit is contained in:
2026-03-12 08:25:55 +08:00
parent 720adbe8a3
commit 5990114151
3 changed files with 35 additions and 2 deletions

View File

@@ -3,6 +3,8 @@ from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
from apps.users.api import views
app_name = "users"
urlpatterns = [
@@ -16,6 +18,12 @@ urlpatterns = [
path("password/change/", views.ChangePasswordView.as_view(), name="change_password"),
path("profile/picture/", views.ProfilePictureView.as_view(), name="profile_picture"),
path("list/", views.UserListView.as_view(), name="user_list"),
path('me/', views.UserProfileViewSet.as_view({
'get': 'retrieve',
'put': 'update',
'patch': 'partial_update',
'delete': 'destroy'
}), name='user-me'),
path("token/obtain/", TokenObtainPairView.as_view(), name="token_obtain_pair"),
path("token/refresh/", TokenRefreshView.as_view(), name="token_refresh"),
]