refactor: cast variable types while computing

This commit is contained in:
Ali BARIN
2021-12-26 16:16:46 +01:00
committed by Ömer Faruk Aydın
parent 3f2f1212c9
commit 06bfba371d

View File

@@ -16,7 +16,13 @@ const computeAuthStepVariables = (variableSchema: any, aggregatedData: any) => {
continue; continue;
} }
variables[variable.name] = template(variable.value, { interpolate })(aggregatedData); const computedVariable = template(variable.value, { interpolate })(aggregatedData);
if (variable.type === 'integer') {
variables[variable.name] = parseInt(computedVariable, 10);
} else {
variables[variable.name] = computedVariable;
}
} }
return variables; return variables;