diff --git a/src/organisation/router.py b/src/organisation/router.py index 9cbfbda..a9672b1 100644 --- a/src/organisation/router.py +++ b/src/organisation/router.py @@ -39,7 +39,7 @@ from src.organisation.schemas import OrgPostOrgRequest, OrgPatchQuestionnaireReq OrgPatchContactRequest, \ OrgPostUserRequest, OrgGetUserResponse, OrgGetContactResponse, OrgGetOrgResponse, OrgPatchRootRequest, \ OrgGetGroupResponse, OrgDeleteUserRequest, OrgDeleteOrgRequest, OrgPostOrgResponse, OrgPatchQuestionnaireResponse, \ - OrgPatchStatusResponse, OrgPostUserResponse, OrgPatchRootResponse, Questionnaire + OrgPatchStatusResponse, OrgPostUserResponse, OrgPatchRootResponse, Questionnaire, OrgPatchContactResponse router = APIRouter( prefix="/org", @@ -319,7 +319,7 @@ async def get_contact(org_model: org_model_root_claim_query_dependency, contact_ @router.patch("/contact", summary="Update contact for organisation.", status_code=status.HTTP_200_OK, - response_model=OrgGetContactResponse, + response_model=OrgPatchContactResponse, responses={ status.HTTP_200_OK: {"description": "Successfully updated contact."}, status.HTTP_422_UNPROCESSABLE_CONTENT: {"description": "Invalid data in request."}, @@ -357,4 +357,4 @@ async def update_contact(db: db_dependency, org_model: org_model_root_claim_body db.commit() - return {"contact": contact_response} + return {"contact": contact_response, "organisation": org_model} diff --git a/src/organisation/schemas.py b/src/organisation/schemas.py index 3ecfe26..e2fd6a4 100644 --- a/src/organisation/schemas.py +++ b/src/organisation/schemas.py @@ -97,6 +97,13 @@ class OrgGetContactResponse(CustomBaseModel): model_config = ConfigDict(from_attributes=True, extra="ignore") contact: ContactModel + organisation: OrgSchema + +class OrgPatchContactResponse(CustomBaseModel): + model_config = ConfigDict(from_attributes=True, extra="ignore") + + contact: ContactModel + organisation: OrgSchema class OrgGetOrgResponse(CustomBaseModel): name: str