From 170e11037849ee5c37657490efbc79a83c0594f7 Mon Sep 17 00:00:00 2001 From: hatim dinia Date: Tue, 23 Jan 2024 15:05:39 +0100 Subject: [PATCH] style(api): update BC endpoints info --- antarest/study/web/study_data_blueprint.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/antarest/study/web/study_data_blueprint.py b/antarest/study/web/study_data_blueprint.py index a1d74379ba..4e79b448dd 100644 --- a/antarest/study/web/study_data_blueprint.py +++ b/antarest/study/web/study_data_blueprint.py @@ -831,7 +831,7 @@ def get_binding_constraint_list( @bp.get( "/studies/{uuid}/bindingconstraints/{binding_constraint_id}", tags=[APITag.study_data], - summary="Get binding constraint list", + summary="Get binding constraint", response_model=None, # Dict[str, bool], ) def get_binding_constraint( @@ -887,45 +887,45 @@ def create_binding_constraint( @bp.post( "/studies/{uuid}/bindingconstraints/{binding_constraint_id}/term", tags=[APITag.study_data], - summary="update constraint term", + summary="Create a binding constraint term", ) def add_constraint_term( uuid: str, binding_constraint_id: str, - data: ConstraintTermDTO, + term: ConstraintTermDTO, current_user: JWTUser = Depends(auth.get_current_user), ) -> Any: logger.info( - f"add constraint term from {binding_constraint_id} for study {uuid}", + f"Add constraint term {term.id} to {binding_constraint_id} for study {uuid}", extra={"user": current_user.id}, ) params = RequestParameters(user=current_user) study = study_service.check_study_access(uuid, StudyPermissionType.WRITE, params) - return study_service.binding_constraint_manager.add_new_constraint_term(study, binding_constraint_id, data) + return study_service.binding_constraint_manager.add_new_constraint_term(study, binding_constraint_id, term) @bp.put( "/studies/{uuid}/bindingconstraints/{binding_constraint_id}/term", tags=[APITag.study_data], - summary="update constraint term", + summary="Update a binding constraint term", ) def update_constraint_term( uuid: str, binding_constraint_id: str, - data: ConstraintTermDTO, + term: ConstraintTermDTO, current_user: JWTUser = Depends(auth.get_current_user), ) -> Any: logger.info( - f"update constraint term from {binding_constraint_id} for study {uuid}", + f"Update constraint term {term.id} from {binding_constraint_id} for study {uuid}", extra={"user": current_user.id}, ) params = RequestParameters(user=current_user) study = study_service.check_study_access(uuid, StudyPermissionType.WRITE, params) - return study_service.binding_constraint_manager.update_constraint_term(study, binding_constraint_id, data) + return study_service.binding_constraint_manager.update_constraint_term(study, binding_constraint_id, term) @bp.delete( "/studies/{uuid}/bindingconstraints/{binding_constraint_id}/term/{term_id}", tags=[APITag.study_data], - summary="update constraint term", + summary="Remove a binding constraint term", ) def remove_constraint_term( uuid: str, @@ -934,7 +934,7 @@ def remove_constraint_term( current_user: JWTUser = Depends(auth.get_current_user), ) -> None: logger.info( - f"delete constraint term {term_id} from {binding_constraint_id} for study {uuid}", + f"Remove constraint term {term_id} from {binding_constraint_id} for study {uuid}", extra={"user": current_user.id}, ) params = RequestParameters(user=current_user)