Skip to content

Commit

Permalink
style(api): update BC endpoints info
Browse files Browse the repository at this point in the history
  • Loading branch information
hdinia committed Jan 24, 2024
1 parent 5ec94fd commit aa63fba
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions antarest/study/web/study_data_blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand All @@ -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)
Expand Down

0 comments on commit aa63fba

Please sign in to comment.