mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix: Fix problem saving workflow when tags disabled (#3792)
* ⚡ Add @AfterLoad nullCheck for WorkflowEntity tags * ⚡ Make tags optional in Entity * Fix workflows api typing issue Co-authored-by: Omar Ajoue <krynble@gmail.com>
This commit is contained in:
@@ -144,7 +144,7 @@ export interface IWorkflowBase extends IWorkflowBaseWorkflow {
|
|||||||
// Almost identical to editor-ui.Interfaces.ts
|
// Almost identical to editor-ui.Interfaces.ts
|
||||||
export interface IWorkflowDb extends IWorkflowBase {
|
export interface IWorkflowDb extends IWorkflowBase {
|
||||||
id: number | string;
|
id: number | string;
|
||||||
tags: ITagDb[];
|
tags?: ITagDb[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IWorkflowToImport extends IWorkflowBase {
|
export interface IWorkflowToImport extends IWorkflowBase {
|
||||||
|
|||||||
@@ -993,7 +993,7 @@ class App {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updatedWorkflow.tags.length && tags?.length) {
|
if (updatedWorkflow.tags?.length && tags?.length) {
|
||||||
updatedWorkflow.tags = TagHelpers.sortByRequestOrder(updatedWorkflow.tags, {
|
updatedWorkflow.tags = TagHelpers.sortByRequestOrder(updatedWorkflow.tags, {
|
||||||
requestOrder: tags,
|
requestOrder: tags,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ workflowsController.post(
|
|||||||
throw new ResponseHelper.ResponseError('Failed to save workflow');
|
throw new ResponseHelper.ResponseError('Failed to save workflow');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tagIds && !config.getEnv('workflowTagsDisabled')) {
|
if (tagIds && !config.getEnv('workflowTagsDisabled') && savedWorkflow.tags) {
|
||||||
savedWorkflow.tags = TagHelpers.sortByRequestOrder(savedWorkflow.tags, {
|
savedWorkflow.tags = TagHelpers.sortByRequestOrder(savedWorkflow.tags, {
|
||||||
requestOrder: tagIds,
|
requestOrder: tagIds,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ export class WorkflowEntity implements IWorkflowDb {
|
|||||||
referencedColumnName: 'id',
|
referencedColumnName: 'id',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
tags: TagEntity[];
|
tags?: TagEntity[];
|
||||||
|
|
||||||
@OneToMany(() => SharedWorkflow, (sharedWorkflow) => sharedWorkflow.workflow)
|
@OneToMany(() => SharedWorkflow, (sharedWorkflow) => sharedWorkflow.workflow)
|
||||||
shared: SharedWorkflow[];
|
shared: SharedWorkflow[];
|
||||||
|
|||||||
Reference in New Issue
Block a user