add get user method callback

This commit is contained in:
Timur
2025-03-01 02:47:52 +03:00
parent 3f8e29c9cb
commit ba54b501eb
+4 -1
View File
@@ -1,5 +1,6 @@
from http import HTTPStatus as status
from django.shortcuts import get_object_or_404
from ninja import Router
from ninja.errors import AuthenticationError
@@ -61,4 +62,6 @@ def sign_in(request, data: LoginSchema):
status.NOT_FOUND: NotFoundError,
},
)
def get_user(request, user_id: str): ...
def get_user(request, user_id: str):
user = get_object_or_404(User, id=user_id)
return status.OK, user