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 { ApplicationError, deepCopy, Workflow } from 'n8n-workflow';
import { ApplicationError, Workflow } from 'n8n-workflow';
import type {
INodeParameterResourceLocator,
IWorkflowExecuteAdditionalData,

View file

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

View file

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