Skip to content

Commit

Permalink
Merge pull request #49138 from Expensify/marcaaron-useJSONCodeMagicCo…
Browse files Browse the repository at this point in the history
…deError

[No QA] Use jsonCode instead of error message
  • Loading branch information
nkuoch authored Sep 20, 2024
2 parents 7af7a3f + e44b522 commit 6510ae4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,7 @@ const CONST = {
EXP_ERROR: 666,
UNABLE_TO_RETRY: 'unableToRetry',
UPDATE_REQUIRED: 426,
INCORRECT_MAGIC_CODE: 451,
},
HTTP_STATUS: {
// When Cloudflare throttles
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/Card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function revealVirtualCardDetails(cardID: number, validateCode: string): Promise
API.makeRequestWithSideEffects(SIDE_EFFECT_REQUEST_COMMANDS.REVEAL_EXPENSIFY_CARD_DETAILS, parameters)
.then((response) => {
if (response?.jsonCode !== CONST.JSON_CODE.SUCCESS) {
if (response?.message === 'Incorrect or invalid magic code. Please try again.') {
if (response?.jsonCode === CONST.JSON_CODE.INCORRECT_MAGIC_CODE) {
// eslint-disable-next-line prefer-promise-reject-errors
reject('validateCodeForm.error.incorrectMagicCode');
return;
Expand Down

0 comments on commit 6510ae4

Please sign in to comment.