From af4df6acc42de8f860a590a52f81e3fa498fad7e Mon Sep 17 00:00:00 2001 From: sebastian Date: Wed, 18 Mar 2026 12:22:36 -0500 Subject: [PATCH] Cambios acerca de implementacion de token y usabilidad de datos --- Back_comercial_iko/app/comercial/Main_comercial.py | 2 +- Back_comercial_iko/services/Comercial_service.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Back_comercial_iko/app/comercial/Main_comercial.py b/Back_comercial_iko/app/comercial/Main_comercial.py index f624153..0d37323 100644 --- a/Back_comercial_iko/app/comercial/Main_comercial.py +++ b/Back_comercial_iko/app/comercial/Main_comercial.py @@ -11,7 +11,7 @@ router = APIRouter(prefix="/comercial", tags=["Comercial"]) def create_project(data: dict, token_data: dict = Depends(TokenDoliManager.verify_header)): try: service = ComercialService() - result = service.create_project_commercial(data) + result = service.create_project_commercial(data, token_data) return ApiResponse.success(result, "Proyecto creado", HttpStatus.CREATED) except Exception as e: return ApiResponse.error(str(e), HttpStatus.NOT_FOUND) \ No newline at end of file diff --git a/Back_comercial_iko/services/Comercial_service.py b/Back_comercial_iko/services/Comercial_service.py index 3f72745..66048c5 100644 --- a/Back_comercial_iko/services/Comercial_service.py +++ b/Back_comercial_iko/services/Comercial_service.py @@ -9,8 +9,9 @@ class ComercialService: self.conn = Database() self.db = self.conn.setConnection() - def create_project_commercial(self, data: dict): + def create_project_commercial(self, data: dict, token_data: dict): + data_session_login = token_data['data'] FieldValidator.required(data.get("ex_societe"), "ex_societe") FieldValidator.required(data.get("nomUser"), "nomUser") nombre_soc = data.get("ex_societe") @@ -21,4 +22,5 @@ class ComercialService: return { "fk_soc": result_soc.ROWID, "nombre_soc": nombre_soc - } \ No newline at end of file + } + \ No newline at end of file