feat: return org summary when creating group

This commit is contained in:
Chris Milne 2026-06-11 16:07:07 +01:00
parent 5d122a7690
commit c74e895bf1
2 changed files with 4 additions and 2 deletions

View file

@ -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(

View file

@ -76,6 +76,7 @@ class IAMPostGroupRequest(OrgIDMixin):
class IAMPostGroupResponse(CustomBaseModel):
organisation: OrgSummary
group: GroupSchema