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; let stepIndex = 0;
while (stepIndex < steps.length) { while (stepIndex < steps.length) {
const step = steps[stepIndex]; const step = steps[stepIndex];
const variables = computeAuthStepVariables(step, response); const variables = computeAuthStepVariables(step.arguments, response);
const stepResponse = await processStep(step, variables); const stepResponse = await processStep(step, variables);

View File

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

View File

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