Skip to content

Commit

Permalink
#136 Match countries using alpha_2, alpha_3, numeric, name, common_na…
Browse files Browse the repository at this point in the history
…me and official_name
  • Loading branch information
mohammadsalem committed Nov 20, 2023
1 parent 2d313f3 commit 3f788ce
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion backend/src/shared/services/formater.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ export class FormatService {
langISO.validate(value) ? langISO.getName(value) : value;

mapIsoToCountry(value: string) {
const country = CountryISO.get({ alpha_2: value }) as Country;
const country = CountryISO.get({
alpha_2: value,
alpha_3: value,
numeric: value,
name: value,
common_name: value,
official_name: value,
}) as Country;
return country ? country.name : this.capitalizeFirstLetter(value);
}

Expand Down

0 comments on commit 3f788ce

Please sign in to comment.