Remove all saves from workflows (#14283)

- replace save by insert
- if the insert output is needed, cast the generatedMaps
- remove transactions from trigger services. Doing it manually would be
complex and not reliable
This commit is contained in:
Thomas Trompette
2025-09-03 15:41:03 +02:00
committed by GitHub
parent 6ee41f33c6
commit 7ac7f52510
8 changed files with 55 additions and 149 deletions
@@ -103,7 +103,7 @@ export class CreateRecordWorkflowAction implements WorkflowAction {
objectMetadataMapItem: objectMetadataItemWithFieldsMaps,
});
const objectRecord = await repository.save({
const insertResult = await repository.insert({
...transformedObjectRecord,
position,
createdBy: {
@@ -112,8 +112,10 @@ export class CreateRecordWorkflowAction implements WorkflowAction {
},
});
const [createdRecord] = insertResult.generatedMaps;
return {
result: objectRecord,
result: createdRecord,
};
}
}