mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 13:06:31 +00:00
fix(plugin-workflow): fix sync collection trigger transaction (#3437)
This commit is contained in:
parent
d692d9cf1b
commit
dada993d80
@ -85,7 +85,8 @@ async function handler(this: CollectionTrigger, workflow: WorkflowModel, data: M
|
|||||||
// TODO: `result.toJSON()` throws error
|
// TODO: `result.toJSON()` throws error
|
||||||
const json = toJSON(result);
|
const json = toJSON(result);
|
||||||
|
|
||||||
const promise = this.workflow.trigger(
|
if (workflow.sync) {
|
||||||
|
await this.workflow.trigger(
|
||||||
workflow,
|
workflow,
|
||||||
{ data: json },
|
{ data: json },
|
||||||
{
|
{
|
||||||
@ -93,9 +94,14 @@ async function handler(this: CollectionTrigger, workflow: WorkflowModel, data: M
|
|||||||
transaction,
|
transaction,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
if (workflow.sync) {
|
this.workflow.trigger(
|
||||||
await promise;
|
workflow,
|
||||||
|
{ data: json },
|
||||||
|
{
|
||||||
|
context,
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user