mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-25 11:31:38 -08:00
fix(editor): Fix Multi option parameter expression when the value is an array (#12430)
This commit is contained in:
parent
76dded4bea
commit
452a7bfe2c
|
@ -365,7 +365,7 @@ const getIssues = computed<string[]>(() => {
|
|||
if (Array.isArray(displayValue.value)) {
|
||||
checkValues = checkValues.concat(displayValue.value);
|
||||
} else {
|
||||
checkValues.push(displayValue.value as string);
|
||||
checkValues = checkValues.concat(displayValue.value?.toString().split(','));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -856,6 +856,8 @@ async function optionSelected(command: string) {
|
|||
(!props.modelValue || props.modelValue === '[Object: null]')
|
||||
) {
|
||||
valueChanged('={{ 0 }}');
|
||||
} else if (props.parameter.type === 'multiOptions') {
|
||||
valueChanged(`={{ ${JSON.stringify(props.modelValue)} }}`);
|
||||
} else if (
|
||||
props.parameter.type === 'number' ||
|
||||
props.parameter.type === 'boolean' ||
|
||||
|
|
|
@ -132,8 +132,11 @@ const evaluatedExpression = computed<Result<unknown, Error>>(() => {
|
|||
}
|
||||
|
||||
if (props.isForCredential) opts.additionalKeys = resolvedAdditionalExpressionData.value;
|
||||
|
||||
return { ok: true, result: workflowHelpers.resolveExpression(value, undefined, opts) };
|
||||
const stringifyExpressionResult = props.parameter.type !== 'multiOptions';
|
||||
return {
|
||||
ok: true,
|
||||
result: workflowHelpers.resolveExpression(value, undefined, opts, stringifyExpressionResult),
|
||||
};
|
||||
} catch (error) {
|
||||
return { ok: false, error };
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue