mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
fix(plugin-workflow): generate workflow key (#6567)
This commit is contained in:
parent
0349edb42c
commit
ec9dbe865a
@ -15,7 +15,7 @@ import LRUCache from 'lru-cache';
|
||||
|
||||
import { Op } from '@nocobase/database';
|
||||
import { Plugin } from '@nocobase/server';
|
||||
import { Registry } from '@nocobase/utils';
|
||||
import { Registry, uid } from '@nocobase/utils';
|
||||
import { SequelizeCollectionManager } from '@nocobase/data-source-manager';
|
||||
import { Logger, LoggerOptions } from '@nocobase/logger';
|
||||
|
||||
@ -75,6 +75,10 @@ export default class PluginWorkflowServer extends Plugin {
|
||||
private onBeforeSave = async (instance: WorkflowModel, { transaction }) => {
|
||||
const Model = <typeof WorkflowModel>instance.constructor;
|
||||
|
||||
if (!instance.key) {
|
||||
instance.set('key', uid());
|
||||
}
|
||||
|
||||
if (instance.enabled) {
|
||||
instance.set('current', true);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user