fix(plugin-workflow): fix node can not be created when stats is bigint (#7099)

This commit is contained in:
Junyi 2025-06-19 16:40:12 +08:00 committed by GitHub
parent 0cbcd03390
commit aa1070ad0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,8 +20,7 @@ export async function create(context: Context, next) {
context.body = await db.sequelize.transaction(async (transaction) => {
const workflow = (await repository.getSourceModel(transaction)) as WorkflowModel;
workflow.versionStats = await workflow.getVersionStats({ transaction });
const { executed } = workflow.versionStats;
if (executed) {
if (workflow.versionStats.executed > 0) {
context.throw(400, 'Node could not be created in executed workflow');
}