refactor: rename fields with arguments and properties
This commit is contained in:
@@ -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);
|
||||||
|
|
||||||
|
@@ -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
|
||||||
}
|
}
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user