From 9bb0fbf4903edb8439c197f03a1d32b8907ccda2 Mon Sep 17 00:00:00 2001 From: Santhoshkumar Sellavel Date: Sat, 5 Mar 2022 19:41:30 +0530 Subject: [PATCH 1/3] IOU Invalid Phone number error handled --- src/languages/en.js | 1 + src/languages/es.js | 3 ++- src/libs/API.js | 6 ++++-- src/libs/actions/IOU.js | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/languages/en.js b/src/languages/en.js index 8efcc9c5d10b..948ed8628940 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -78,6 +78,7 @@ export default { error: { invalidAmount: 'Invalid amount', acceptedTerms: 'You must accept the Terms of Service to continue', + phoneNumber: 'Please enter a valid phone number, with the country code (e.g. +1234567890)', }, please: 'Please', contactUs: 'contact us', diff --git a/src/languages/es.js b/src/languages/es.js index 1361d5e07251..f8f7f407c38b 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -78,6 +78,7 @@ export default { error: { invalidAmount: 'Monto no válido', acceptedTerms: 'Debes aceptar los Términos de servicio para continuar', + phoneNumber: 'Ingresa un teléfono válido, incluyendo el código de país (p. ej. +1234567890)', }, please: 'Por favor', contactUs: 'contáctenos', @@ -809,7 +810,7 @@ export default { invite: { invitePeople: 'Invitar nuevos miembros', personalMessagePrompt: 'Agregar un mensaje personal (Opcional)', - pleaseSelectUser: 'Asegúrese de que el correo electrónico o el número de teléfono sean válidos (e.g. +15005550006).', + pleaseSelectUser: 'Asegúrese de que el correo electrónico o el número de teléfono sean válidos (p. ej. +15005550006).', genericFailureMessage: 'Se produjo un error al invitar al usuario al espacio de trabajo. Vuelva a intentarlo..', welcomeNote: ({workspaceName}) => `¡Has sido invitado a ${workspaceName}! Descargue la aplicación móvil Expensify en use.expensify.com/download para comenzar a rastrear sus gastos.`, }, diff --git a/src/libs/API.js b/src/libs/API.js index b76675cc9dfa..3f1de930f371 100644 --- a/src/libs/API.js +++ b/src/libs/API.js @@ -179,8 +179,10 @@ Network.registerResponseHandler((queuedRequest, response) => { return; } - if (response.jsonCode === 405 || response.jsonCode === 404) { - // IOU Split & Request money transactions failed due to invalid amount(405) or unable to split(404) + if (response.jsonCode === 405 || response.jsonCode === 404 || response.jsonCode === 402) { + // IOU Split & Request money transactions failed, due to invalid amount(405), unable to split(404), + // invalid Phone number(402) + // It's a failure, so reject the queued request queuedRequest.reject(response); return; diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index 063f586d1ad0..042ee8db109d 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -66,6 +66,8 @@ function getIOUErrorMessage(error) { return Localize.translateLocal('common.error.invalidAmount'); } if (error.jsonCode === 404) { return Localize.translateLocal('iou.error.invalidSplit'); + } if (error.jsonCode === 402) { + return Localize.translateLocal('common.error.phoneNumber'); } } return Localize.translateLocal('iou.error.other'); From ad85566997ac63ddc3a9b399a453e5d18f376bf2 Mon Sep 17 00:00:00 2001 From: Santhoshkumar Sellavel Date: Mon, 7 Mar 2022 22:37:23 +0530 Subject: [PATCH 2/3] Minor changes --- src/libs/API.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libs/API.js b/src/libs/API.js index 3f1de930f371..c636a64fe8c7 100644 --- a/src/libs/API.js +++ b/src/libs/API.js @@ -180,9 +180,7 @@ Network.registerResponseHandler((queuedRequest, response) => { } if (response.jsonCode === 405 || response.jsonCode === 404 || response.jsonCode === 402) { - // IOU Split & Request money transactions failed, due to invalid amount(405), unable to split(404), - // invalid Phone number(402) - + // IOU Split & Request money transactions failed, due to invalid amount(405), unable to split(404), invalid Phone number(402) // It's a failure, so reject the queued request queuedRequest.reject(response); return; From 8fd9135b2e0d5d6b2180beb580df0d2e26f3789a Mon Sep 17 00:00:00 2001 From: Santhoshkumar Sellavel <85645967+Santhosh-Sellavel@users.noreply.github.com> Date: Mon, 7 Mar 2022 22:50:22 +0530 Subject: [PATCH 3/3] Update src/libs/API.js Typo Co-authored-by: Rushat Gabhane --- src/libs/API.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/API.js b/src/libs/API.js index c636a64fe8c7..0ca6ae1f1276 100644 --- a/src/libs/API.js +++ b/src/libs/API.js @@ -180,7 +180,7 @@ Network.registerResponseHandler((queuedRequest, response) => { } if (response.jsonCode === 405 || response.jsonCode === 404 || response.jsonCode === 402) { - // IOU Split & Request money transactions failed, due to invalid amount(405), unable to split(404), invalid Phone number(402) + // IOU Split & Request money transactions failed, due to invalid amount(405), unable to split(404), invalid phone number(402) // It's a failure, so reject the queued request queuedRequest.reject(response); return;