Uppercased the country code to prevent API errors
This commit is contained in:
@@ -43,7 +43,7 @@ async function get(req: NextApiRequest, res: NextApiResponse) {
|
||||
return newUser;
|
||||
}) as Contact[];
|
||||
|
||||
const country = countryCodes.findOne("countryCode" as any, code);
|
||||
const country = countryCodes.findOne("countryCode" as any, code.toUpperCase());
|
||||
const key = language === 'ar' ? 'countryNameLocal' : 'countryNameEn';
|
||||
|
||||
res.json({
|
||||
|
||||
@@ -51,7 +51,7 @@ async function get(req: NextApiRequest, res: NextApiResponse) {
|
||||
) as Record<string, Contact[]>;
|
||||
|
||||
const result = Object.keys(data).map((code) => {
|
||||
const country = countryCodes.findOne("countryCode" as any, code);
|
||||
const country = countryCodes.findOne("countryCode" as any, code.toUpperCase());
|
||||
const key = language === 'ar' ? 'countryNameLocal' : 'countryNameEn';
|
||||
return {
|
||||
label: country[key],
|
||||
|
||||
Reference in New Issue
Block a user