From c6c025a662f016b1bdd9987e2babf23f440af517 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Sun, 20 Aug 2023 18:50:57 +0300 Subject: [PATCH] fix: country mapping fix (#896) --- packages/config/cspell.base.cjs | 3 +++ .../workflows-service/scripts/workflows/utils/countries.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/config/cspell.base.cjs b/packages/config/cspell.base.cjs index 09609c05fd..c3034f7187 100644 --- a/packages/config/cspell.base.cjs +++ b/packages/config/cspell.base.cjs @@ -101,6 +101,9 @@ module.exports = { '.vscode/**', 'tsconfig.tsbuildinfo', 'stats.html', + 'currency-codes.ts', + 'states.ts', + 'countries.ts', ], flagWords: [], dictionaries: ['workspace'], diff --git a/services/workflows-service/scripts/workflows/utils/countries.ts b/services/workflows-service/scripts/workflows/utils/countries.ts index fcf3994561..6f5310a22d 100644 --- a/services/workflows-service/scripts/workflows/utils/countries.ts +++ b/services/workflows-service/scripts/workflows/utils/countries.ts @@ -261,7 +261,7 @@ export interface ICountry { export const getCountriesList = (): ICountry[] => Object.entries(isoCountriesRecord).map(([isoCode, fullName]) => ({ isoCode, - fullName: fullName as string, + fullName: Array.isArray(fullName) ? fullName[0] : (fullName as string), })); export const getCountryStates = (countryCode: string) => {