mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 23:49:27 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
d94bb4a390
@ -15,7 +15,7 @@ import LRUCache from 'lru-cache';
|
|||||||
|
|
||||||
import { Op } from '@nocobase/database';
|
import { Op } from '@nocobase/database';
|
||||||
import { Plugin } from '@nocobase/server';
|
import { Plugin } from '@nocobase/server';
|
||||||
import { Registry } from '@nocobase/utils';
|
import { Registry, uid } from '@nocobase/utils';
|
||||||
import { SequelizeCollectionManager } from '@nocobase/data-source-manager';
|
import { SequelizeCollectionManager } from '@nocobase/data-source-manager';
|
||||||
import { Logger, LoggerOptions } from '@nocobase/logger';
|
import { Logger, LoggerOptions } from '@nocobase/logger';
|
||||||
|
|
||||||
@ -75,6 +75,10 @@ export default class PluginWorkflowServer extends Plugin {
|
|||||||
private onBeforeSave = async (instance: WorkflowModel, { transaction }) => {
|
private onBeforeSave = async (instance: WorkflowModel, { transaction }) => {
|
||||||
const Model = <typeof WorkflowModel>instance.constructor;
|
const Model = <typeof WorkflowModel>instance.constructor;
|
||||||
|
|
||||||
|
if (!instance.key) {
|
||||||
|
instance.set('key', uid());
|
||||||
|
}
|
||||||
|
|
||||||
if (instance.enabled) {
|
if (instance.enabled) {
|
||||||
instance.set('current', true);
|
instance.set('current', true);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user