diff --git a/src/iam/router.py b/src/iam/router.py index 77c02e0..7a2bbe4 100644 --- a/src/iam/router.py +++ b/src/iam/router.py @@ -282,9 +282,10 @@ async def create_group( or "UNIQUE constraint failed" in str(e.orig) # SQLite unique violation ): raise ConflictException("Group with this name already exists") - response = GroupSchema(**group_model.__dict__) + group_response = GroupSchema(**group_model.__dict__) + org_response = OrgSummary(**org_model.__dict__) db.commit() - return {"group": response} + return {"group": group_response, "organisation": org_response} @router.put( diff --git a/src/iam/schemas.py b/src/iam/schemas.py index 1cae77e..7d79154 100644 --- a/src/iam/schemas.py +++ b/src/iam/schemas.py @@ -76,6 +76,7 @@ class IAMPostGroupRequest(OrgIDMixin): class IAMPostGroupResponse(CustomBaseModel): + organisation: OrgSummary group: GroupSchema