From 13eebcf7e23b0068686f859d12f860fbc6fc7957 Mon Sep 17 00:00:00 2001 From: Michael Piazza Date: Wed, 5 Oct 2022 19:01:48 -0400 Subject: [PATCH] [PAY-670] New emoji error code --- packages/common/src/utils/aaoErrorCodes.ts | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/common/src/utils/aaoErrorCodes.ts b/packages/common/src/utils/aaoErrorCodes.ts index 93ca077cd9..91bf91920f 100644 --- a/packages/common/src/utils/aaoErrorCodes.ts +++ b/packages/common/src/utils/aaoErrorCodes.ts @@ -1,19 +1,19 @@ -const aaoErrorEmojis = [ - '๐Ÿ˜“', - '๐Ÿ˜ญ', - '๐Ÿ˜ฅ', - '๐Ÿ˜ฎ', - '๐Ÿคฌ', - '๐Ÿ˜ท', - '๐Ÿ˜ฟ', - '๐Ÿ˜ค', - '๐Ÿ™', - '๐Ÿ™„', - '๐Ÿ˜ฃ', - '๐Ÿ˜ฆ', - '๐Ÿคจ' -] - +const aaoErrorEmojis = { + 0: '๐Ÿ˜“', + 1: '๐Ÿ˜ญ', + 2: '๐Ÿ˜ฅ', + 3: '๐Ÿ˜ฎ', + 4: '๐Ÿคฌ', + 5: '๐Ÿ˜ท', + 6: '๐Ÿ˜ฟ', + 7: '๐Ÿ˜ค', + 8: '๐Ÿ™', + 9: '๐Ÿ™„', + 10: '๐Ÿ˜ฃ', + 11: '๐Ÿ˜ฆ', + 12: '๐Ÿ˜”', + '-1': '๐Ÿคจ' +} /** * Negative numbers are unexpected but valid, return last emoji. * Positive numbers are expected, return emoji at index of error code. @@ -21,5 +21,5 @@ const aaoErrorEmojis = [ * invalid, but ignore them and return last emoji to avoid errors. **/ export const getAAOErrorEmojis = (errorCode: number): string => { - return aaoErrorEmojis[errorCode] ?? aaoErrorEmojis[aaoErrorEmojis.length - 1] + return aaoErrorEmojis[errorCode] ?? aaoErrorEmojis[-1] }