From 543ba8870c8e0a13ea7ea106f9a4a2b3962fa320 Mon Sep 17 00:00:00 2001 From: "Juan M. Ley" Date: Tue, 5 May 2026 09:57:52 -0600 Subject: [PATCH] Added the isAdmin parameter to schemas and users in that api. --- src/infrastructure/api/users/schemas.py | 1 + src/infrastructure/api/users/users.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/infrastructure/api/users/schemas.py b/src/infrastructure/api/users/schemas.py index 53db010..797eedb 100644 --- a/src/infrastructure/api/users/schemas.py +++ b/src/infrastructure/api/users/schemas.py @@ -33,6 +33,7 @@ class UserLoginResponse(BaseModel): token_type: str = Field(default="bearer", description="Tipo de token") user_id: int = Field(..., description="ID del usuario") email: str = Field(..., description="Email del usuario") + is_admin: bool = Field(..., description="Indica si el usuario es administrador") class UserResponse(BaseModel): """Respuesta con datos de usuario""" diff --git a/src/infrastructure/api/users/users.py b/src/infrastructure/api/users/users.py index ed06d14..b1a7ed0 100644 --- a/src/infrastructure/api/users/users.py +++ b/src/infrastructure/api/users/users.py @@ -61,7 +61,8 @@ async def login_user(credentials: UserLoginRequest): "access_token": access_token, "token_type": "bearer", "user_id": user.user_id, - "email": user.email + "email": user.email, + "is_admin": user.is_admin } except HTTPException: