Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 3be1b3e

Browse files
author
dengjun
committed
fix phone validation
1 parent a6f684c commit 3be1b3e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/containers/MyGigs/modals/UpdateGigProfile/index.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ const UpdateGigProfile = ({
7676
validation.file = profileEdit.fileError;
7777
}
7878

79-
if (!profileEdit.file) {
80-
validation = validation || {};
81-
validation.file = "Please, pick your CV file for uploading";
82-
}
79+
// if (!profileEdit.file) {
80+
// validation = validation || {};
81+
// validation.file = "Please, pick your CV file for uploading";
82+
// }
8383

8484
if ((error = utils.myGig.validateCity(profileEdit.city))) {
8585
validation = validation || {};

src/utils/myGig.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,14 @@ export function validateCity(value) {
5353
}
5454

5555
export function validatePhone(phoneNumber, country) {
56-
const countryCode = countries.getAlpha2Code(country, "en") || "US";
5756
let error = validateTextRequired(phoneNumber);
5857
if (error) {
5958
return error;
6059
}
6160

6261
phoneNumber = phoneNumber.trim();
6362

64-
const code = codes.find((i) => i.isoCode2 === countryCode);
63+
const code = codes.find((i) => i.isoCode3 === country);
6564
const regionCode = `+${code.countryCodes[0]}`;
6665

6766
error = !phoneNumber.startsWith(regionCode) && "Invalid country code";

0 commit comments

Comments
 (0)