Skip to content

Commit 59aebc7

Browse files
authored
Fix : add and edit structure (#717)
### Description - allow to unset a required membership when patching a structure - return the membership relationship when creating the structure Co-authored-by: Foucauld Bellanger <[email protected]>
1 parent 94d63dd commit 59aebc7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/core/myeclpay/cruds_myeclpay.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async def update_structure(
3838
await db.execute(
3939
update(models_myeclpay.Structure)
4040
.where(models_myeclpay.Structure.id == structure_id)
41-
.values(**structure_update.model_dump(exclude_none=True)),
41+
.values(**structure_update.model_dump(exclude_unset=True)),
4242
)
4343

4444

app/core/myeclpay/endpoints_myeclpay.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ async def create_structure(
154154
await db.rollback()
155155
raise
156156

157-
return structure_db
157+
return await cruds_myeclpay.get_structure_by_id(structure_db.id, db)
158158

159159

160160
@router.patch(

0 commit comments

Comments
 (0)