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;
|
||||
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);
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user