parent
8a9f03ee0b
commit
af680dbc38
2 changed files with 10 additions and 3 deletions
|
|
@ -39,7 +39,7 @@ from src.organisation.schemas import OrgPostOrgRequest, OrgPatchQuestionnaireReq
|
||||||
OrgPatchContactRequest, \
|
OrgPatchContactRequest, \
|
||||||
OrgPostUserRequest, OrgGetUserResponse, OrgGetContactResponse, OrgGetOrgResponse, OrgPatchRootRequest, \
|
OrgPostUserRequest, OrgGetUserResponse, OrgGetContactResponse, OrgGetOrgResponse, OrgPatchRootRequest, \
|
||||||
OrgGetGroupResponse, OrgDeleteUserRequest, OrgDeleteOrgRequest, OrgPostOrgResponse, OrgPatchQuestionnaireResponse, \
|
OrgGetGroupResponse, OrgDeleteUserRequest, OrgDeleteOrgRequest, OrgPostOrgResponse, OrgPatchQuestionnaireResponse, \
|
||||||
OrgPatchStatusResponse, OrgPostUserResponse, OrgPatchRootResponse, Questionnaire
|
OrgPatchStatusResponse, OrgPostUserResponse, OrgPatchRootResponse, Questionnaire, OrgPatchContactResponse
|
||||||
|
|
||||||
router = APIRouter(
|
router = APIRouter(
|
||||||
prefix="/org",
|
prefix="/org",
|
||||||
|
|
@ -319,7 +319,7 @@ async def get_contact(org_model: org_model_root_claim_query_dependency, contact_
|
||||||
@router.patch("/contact",
|
@router.patch("/contact",
|
||||||
summary="Update contact for organisation.",
|
summary="Update contact for organisation.",
|
||||||
status_code=status.HTTP_200_OK,
|
status_code=status.HTTP_200_OK,
|
||||||
response_model=OrgGetContactResponse,
|
response_model=OrgPatchContactResponse,
|
||||||
responses={
|
responses={
|
||||||
status.HTTP_200_OK: {"description": "Successfully updated contact."},
|
status.HTTP_200_OK: {"description": "Successfully updated contact."},
|
||||||
status.HTTP_422_UNPROCESSABLE_CONTENT: {"description": "Invalid data in request."},
|
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()
|
db.commit()
|
||||||
|
|
||||||
return {"contact": contact_response}
|
return {"contact": contact_response, "organisation": org_model}
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,13 @@ class OrgGetContactResponse(CustomBaseModel):
|
||||||
model_config = ConfigDict(from_attributes=True, extra="ignore")
|
model_config = ConfigDict(from_attributes=True, extra="ignore")
|
||||||
|
|
||||||
contact: ContactModel
|
contact: ContactModel
|
||||||
|
organisation: OrgSchema
|
||||||
|
|
||||||
|
class OrgPatchContactResponse(CustomBaseModel):
|
||||||
|
model_config = ConfigDict(from_attributes=True, extra="ignore")
|
||||||
|
|
||||||
|
contact: ContactModel
|
||||||
|
organisation: OrgSchema
|
||||||
|
|
||||||
class OrgGetOrgResponse(CustomBaseModel):
|
class OrgGetOrgResponse(CustomBaseModel):
|
||||||
name: str
|
name: str
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue