addressing comments

This commit is contained in:
Ivan Atanasov 2024-12-05 16:29:43 +01:00
parent 0e532992bd
commit f131e9381a
No known key found for this signature in database
4 changed files with 6 additions and 7 deletions

View file

@ -1,5 +1,5 @@
import { get } from 'lodash'; import { get } from 'lodash';
import { ApplicationError, deepCopy, Workflow } from 'n8n-workflow'; import { ApplicationError, Workflow } from 'n8n-workflow';
import type { import type {
INodeParameterResourceLocator, INodeParameterResourceLocator,
IWorkflowExecuteAdditionalData, IWorkflowExecuteAdditionalData,

View file

@ -244,9 +244,8 @@ async function loadFieldsToMap(): Promise<void> {
return; return;
} }
const resourceMapperMethod = props.parameter.typeOptions?.resourceMapper?.resourceMapperMethod; const { resourceMapperMethod = undefined, localResourceMapperMethod = undefined } =
const localResourceMapperMethod = props.parameter.typeOptions?.resourceMapper ?? {};
props.parameter.typeOptions?.resourceMapper?.localResourceMapperMethod;
let fetchedFields = null; let fetchedFields = null;

View file

@ -16,7 +16,7 @@ import {
VALUES, VALUES,
TYPE_OPTIONS, TYPE_OPTIONS,
INPUT_OPTIONS, INPUT_OPTIONS,
DEFAULT_PLACEHOLDER, FALLBACK_DEFAULT_VALUE,
} from './constants'; } from './constants';
const SUPPORTED_TYPES = TYPE_OPTIONS.map((x) => x.value); const SUPPORTED_TYPES = TYPE_OPTIONS.map((x) => x.value);
@ -123,7 +123,7 @@ export function getWorkflowInputData(
try { try {
for (const { name, type } of newParams) { for (const { name, type } of newParams) {
if (!item.json.hasOwnProperty(name)) { if (!item.json.hasOwnProperty(name)) {
newItem.json[name] = DEFAULT_PLACEHOLDER; newItem.json[name] = FALLBACK_DEFAULT_VALUE;
continue; continue;
} }

View file

@ -33,4 +33,4 @@ export const TYPE_OPTIONS: Array<{ name: string; value: FieldType | 'any' }> = [
// Intentional omission of `dateTime`, `time`, `string-alphanumeric`, `form-fields`, `jwt` and `url` // Intentional omission of `dateTime`, `time`, `string-alphanumeric`, `form-fields`, `jwt` and `url`
]; ];
export const DEFAULT_PLACEHOLDER = null; export const FALLBACK_DEFAULT_VALUE = null;