fix: onSucess & onError action selector () => {} (#12753)

This commit is contained in:
Arsalan Yaldram 2022-04-26 20:01:23 +05:30 committed by GitHub
parent cd84b63373
commit 4dabbd8f13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -191,7 +191,7 @@ function getFieldFromValue(
const errorArg = args[1] ? args[1][0] : "() => {}";
const successArg = changeValue.endsWith(")")
? `() => ${changeValue}`
: `() => ${changeValue}()`;
: `() => {}`;
return value.replace(
ACTION_TRIGGER_REGEX,
@ -217,7 +217,8 @@ function getFieldFromValue(
const successArg = args[0] ? args[0][0] : "() => {}";
const errorArg = changeValue.endsWith(")")
? `() => ${changeValue}`
: `() => ${changeValue}()`;
: `() => {}`;
return value.replace(
ACTION_TRIGGER_REGEX,
`{{$1(${successArg}, ${errorArg})}}`,