From 9f74fc2be46055411626e13e9e17405d0d778fae Mon Sep 17 00:00:00 2001 From: Nathalie Kuoch Date: Thu, 10 Mar 2022 10:17:20 +0100 Subject: [PATCH] Use nextStepValues and fix typo --- .../actions/ReimbursementAccount/setupWithdrawalAccount.js | 2 +- src/libs/actions/Wallet.js | 4 ++-- src/pages/EnablePayments/IdologyQuestions.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/actions/ReimbursementAccount/setupWithdrawalAccount.js b/src/libs/actions/ReimbursementAccount/setupWithdrawalAccount.js index fbd85d89ee31..c3c713c512c6 100644 --- a/src/libs/actions/ReimbursementAccount/setupWithdrawalAccount.js +++ b/src/libs/actions/ReimbursementAccount/setupWithdrawalAccount.js @@ -231,7 +231,7 @@ function setupWithdrawalAccount(params) { // Example 1: When forcing manual step after adding Chase bank account via Plaid, so we can ask for the real numbers instead of the plaid substitutes // Example 2: When on the requestor step, showing Onfido view after submitting the identity and retrieving the sdkToken if (_.has(responseACHData, 'nextStepValues')) { - navigation.goToWithdrawalAccountSetupStep(_.get(responseACHData.nextStepValues, 'currentStep') || nextStep, { + navigation.goToWithdrawalAccountSetupStep(lodashGet(responseACHData, 'nextStepValues.currentStep') || nextStep, { ...updatedACHData, ...(_.omit(responseACHData, 'nextStepValues')), ...responseACHData.nextStepValues, diff --git a/src/libs/actions/Wallet.js b/src/libs/actions/Wallet.js index e89437e7218a..facbfd6e076a 100644 --- a/src/libs/actions/Wallet.js +++ b/src/libs/actions/Wallet.js @@ -236,7 +236,7 @@ function activateWallet(currentStep, parameters) { return; } - let qualifiers = _.get(response, ['data', 'requestorIdentityID', 'apiResult', 'qualifiers', 'qualifier'], []); + let qualifiers = lodashGet(response, 'data.requestorIdentityID.apiResult.qualifiers.qualifier', []); // ExpectID sometimes returns qualifier as an object when there is only one, or as an array if there are several if (qualifiers.key) { @@ -268,7 +268,7 @@ function activateWallet(currentStep, parameters) { } } - if (_.get(response, ['data', 'requestorIdentityID', 'apiResult', 'results', 'key']) === 'result.no.match' + if (lodashGet(response, 'data.requestorIdentityID.apiResult.results.key') === 'result.no.match' || response.title === CONST.WALLET.ERROR.WRONG_ANSWERS) { setAdditionalDetailsShouldShowFailedKYC(true); return; diff --git a/src/pages/EnablePayments/IdologyQuestions.js b/src/pages/EnablePayments/IdologyQuestions.js index 2b42959502a2..cd8ff54411bd 100644 --- a/src/pages/EnablePayments/IdologyQuestions.js +++ b/src/pages/EnablePayments/IdologyQuestions.js @@ -123,7 +123,7 @@ class IdologyQuestions extends React.Component { render() { const questionIndex = this.state.questionNumber; const question = this.props.questions[questionIndex] || {}; - const possibleAnwers = _.filter(_.map(question.answer, (answer) => { + const possibleAnswers = _.filter(_.map(question.answer, (answer) => { if (this.state.hideSkip && answer === SKIP_QUESTION_TEXT) { return; } @@ -149,7 +149,7 @@ class IdologyQuestions extends React.Component { {question.prompt} this.chooseAnswer(questionIndex, answer)} />