mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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)) {
|
if (Array.isArray(displayValue.value)) {
|
||||||
checkValues = checkValues.concat(displayValue.value);
|
checkValues = checkValues.concat(displayValue.value);
|
||||||
} else {
|
} 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]')
|
(!props.modelValue || props.modelValue === '[Object: null]')
|
||||||
) {
|
) {
|
||||||
valueChanged('={{ 0 }}');
|
valueChanged('={{ 0 }}');
|
||||||
|
} else if (props.parameter.type === 'multiOptions') {
|
||||||
|
valueChanged(`={{ ${JSON.stringify(props.modelValue)} }}`);
|
||||||
} else if (
|
} else if (
|
||||||
props.parameter.type === 'number' ||
|
props.parameter.type === 'number' ||
|
||||||
props.parameter.type === 'boolean' ||
|
props.parameter.type === 'boolean' ||
|
||||||
|
|
|
@ -132,8 +132,11 @@ const evaluatedExpression = computed<Result<unknown, Error>>(() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.isForCredential) opts.additionalKeys = resolvedAdditionalExpressionData.value;
|
if (props.isForCredential) opts.additionalKeys = resolvedAdditionalExpressionData.value;
|
||||||
|
const stringifyExpressionResult = props.parameter.type !== 'multiOptions';
|
||||||
return { ok: true, result: workflowHelpers.resolveExpression(value, undefined, opts) };
|
return {
|
||||||
|
ok: true,
|
||||||
|
result: workflowHelpers.resolveExpression(value, undefined, opts, stringifyExpressionResult),
|
||||||
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return { ok: false, error };
|
return { ok: false, error };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue