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 142093c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ services:
build: frontend
restart: always
ports:
- 80:80
- 9393:80
depends_on:
- elasticsearch
- backend
Expand Down

0 comments on commit 142093c

Please sign in to comment.