mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 19:07:10 +00:00
Merge branch 'master' of https://gitlab.prodcontest.ru/team-15/project
This commit is contained in:
@@ -22,4 +22,4 @@ class LoginSchema(ModelSchema):
|
|||||||
class UserSchema(ModelSchema):
|
class UserSchema(ModelSchema):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = User
|
model = User
|
||||||
fields = ["email", "username"]
|
fields = ["id", "email", "username"]
|
||||||
|
|||||||
@@ -54,6 +54,16 @@ def sign_in(request, data: LoginSchema):
|
|||||||
return status.OK, TokenSchema(token=token)
|
return status.OK, TokenSchema(token=token)
|
||||||
|
|
||||||
|
|
||||||
|
@router.get(
|
||||||
|
"/me",
|
||||||
|
response={
|
||||||
|
status.OK: UserSchema,
|
||||||
|
status.UNAUTHORIZED: ForbiddenError,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
def get_me(request):
|
||||||
|
return 200, request.auth
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
path="/user/{user_id}",
|
path="/user/{user_id}",
|
||||||
response={
|
response={
|
||||||
|
|||||||
Reference in New Issue
Block a user