refactor: rename fields with arguments and properties

This commit is contained in:
Ali BARIN
2021-10-26 23:55:02 +02:00
parent 65a41ff492
commit 2f7cde95da
3 changed files with 10 additions and 10 deletions

View File

@@ -49,7 +49,7 @@ export default function AddAppConnection(props: AddAppConnectionProps){
let stepIndex = 0;
while (stepIndex < steps.length) {
const step = steps[stepIndex];
const variables = computeAuthStepVariables(step, response);
const variables = computeAuthStepVariables(step.arguments, response);
const stepResponse = await processStep(step, variables);

View File

@@ -23,10 +23,10 @@ export const GET_APP = gql`
step
type
name
fields {
arguments {
name
value
fields {
properties {
name
value
}
@@ -36,10 +36,10 @@ export const GET_APP = gql`
step
type
name
fields {
arguments {
name
value
fields {
properties {
name
value
}

View File

@@ -6,17 +6,17 @@ type VARIABLES = {
[key: string]: any
}
const computeAuthStepVariables = (authStep: any, aggregatedData: any) => {
const computeAuthStepVariables = (variableSchema: any, aggregatedData: any) => {
const variables: VARIABLES = {};
for (const field of authStep.fields) {
if (field.fields) {
variables[field.name] = computeAuthStepVariables(field, aggregatedData);
for (const variable of variableSchema) {
if (variable.properties) {
variables[variable.name] = computeAuthStepVariables(variable.properties, aggregatedData);
continue;
}
variables[field.name] = template(field.value, { interpolate })(aggregatedData);
variables[variable.name] = template(variable.value, { interpolate })(aggregatedData);
}
return variables;