Skip to content

Commit

Permalink
⚡ fix
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-radency committed Oct 12, 2023
1 parent 2b6a15e commit fd4de72
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/nodes-base/nodes/Set/Set.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ export class Set extends VersionedNodeType {
icon: 'fa:pen',
group: ['input'],
description: 'Add or edit fields on an input item and optionally remove other fields',
defaultVersion: 3.1,
defaultVersion: 3.2,
};

const nodeVersions: IVersionedNodeType['nodeVersions'] = {
1: new SetV1(baseDescription),
2: new SetV1(baseDescription),
3: new SetV2(baseDescription),
3.1: new SetV2(baseDescription),
3.2: new SetV2(baseDescription),
};

super(nodeVersions, baseDescription);
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Set/v2/SetV2.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const versionDescription: INodeTypeDescription = {
name: 'set',
icon: 'fa:pen',
group: ['input'],
version: [3, 3.1],
version: [3, 3.1, 3.2],
description: 'Change the structure of your items',
subtitle: '={{$parameter["mode"]}}',
defaults: {
Expand Down
5 changes: 5 additions & 0 deletions packages/nodes-base/nodes/Set/v2/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ export const validateEntry = (
) => {
let entryValue = entry[entry.type];
const name = entry.name;

if (nodeVersion && nodeVersion >= 3.2 && (entryValue === undefined || entryValue === null)) {
return { name, value: null };
}

const entryType = entry.type.replace('Value', '') as FieldType;

const description = `To fix the error try to change the type for the field "${name}" or activate the option “Ignore Type Conversion Errors” to apply a less strict type validation`;
Expand Down

0 comments on commit fd4de72

Please sign in to comment.