Skip to content

Commit 3f1016f

Browse files
fix(core): Assign execute method to declarative nodes even if they have methods property (#17796)
1 parent bc97584 commit 3f1016f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/cli/src/__tests__/utils.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,20 @@ describe('shouldAssignExecuteMethod', () => {
5858
expect(shouldAssignExecuteMethod(nodeType)).toBe(true);
5959
});
6060

61-
it('should return false when node has methods', () => {
61+
it('should return false when node has methods and is not declarative', () => {
6262
const nodeType = {
6363
methods: {},
6464
} as unknown as INodeType;
6565

6666
expect(shouldAssignExecuteMethod(nodeType)).toBe(false);
6767
});
68+
69+
it('should return true when node has methods but is declarative', () => {
70+
const nodeType = {
71+
description: { requestDefaults: {} }, // Declarative node
72+
methods: {},
73+
} as unknown as INodeType;
74+
75+
expect(shouldAssignExecuteMethod(nodeType)).toBe(true);
76+
});
6877
});

packages/cli/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ export const shouldAssignExecuteMethod = (nodeType: INodeType) => {
8989
!nodeType.poll &&
9090
!nodeType.trigger &&
9191
(!nodeType.webhook || isDeclarativeNode) &&
92-
!nodeType.methods
92+
(!nodeType.methods || isDeclarativeNode)
9393
);
9494
};

0 commit comments

Comments
 (0)