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