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

Commit 83b44cc

Browse files
author
dengjun
committed
ci:fixing countryCodes
1 parent bb7e21d commit 83b44cc

File tree

7 files changed

+20
-9
lines changed

7 files changed

+20
-9
lines changed

config/default.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
COMMUNITY_APP: "https://community-app.topcoder-dev.com",
1313
PLATFORM_WEBSITE_URL: "https://platform.topcoder-dev.com",
1414
},
15-
RECRUIT_API: process.env.RECRUIT_API || "https://www.topcoder-dev.com",
15+
RECRUIT_API: "https://www.topcoder-dev.com",
1616
// the server api base path
1717
API_BASE_PATH: process.env.API_BASE_PATH || "/earn-app/api/my-gigs",
1818
// the log level, default is 'debug'

config/development.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ module.exports = {
1111
COMMUNITY_APP: "https://community-app.topcoder-dev.com",
1212
PLATFORM_WEBSITE_URL: "https://platform.topcoder-dev.com",
1313
},
14-
RECRUIT_API: process.env.RECRUIT_API || "https://www.topcoder-dev.com",
14+
RECRUIT_API: "https://www.topcoder-dev.com",
1515
};

config/production.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ module.exports = {
1111
COMMUNITY_APP: "https://community-app.topcoder.com",
1212
PLATFORM_WEBSITE_URL: "https://platform.topcoder.com",
1313
},
14-
RECRUIT_API: process.env.RECRUIT_API || "https://www.topcoder.com",
14+
RECRUIT_API: "https://www.topcoder.com",
1515
};

src/api/common/helper.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,8 @@ async function updateRCRMProfile(currentUser, file, data) {
435435
.set("Accept", "application/json")
436436
.field("phone", data.phone)
437437
.field("availability", data.availability)
438+
.field("city", data.city)
439+
.field("countryName", data.countryName)
438440
.attach("resume", file.data, file.name);
439441
localLogger.debug({
440442
context: "updateRCRMProfile",

src/containers/MyGigs/index.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ const MyGigs = ({
2424
// getStatuses,
2525
updateProfile,
2626
updateProfileSuccess,
27+
getAllCountries,
2728
}) => {
2829
const propsRef = useRef();
29-
propsRef.current = { getMyGigs, getProfile };
30+
propsRef.current = { getMyGigs, getProfile, getAllCountries};
3031

3132
useEffect(() => {
3233
propsRef.current.getMyGigs();
3334
propsRef.current.getProfile();
35+
propsRef.current.getAllCountries();
3436
// propsRef.current.getStatuses();
3537
}, []);
3638

@@ -109,6 +111,7 @@ MyGigs.propTypes = {
109111
// getStatuses: PT.func,
110112
updateProfile: PT.func,
111113
updateProfileSuccess: PT.bool,
114+
getAllCountries: PT.func
112115
};
113116

114117
const mapStateToProps = (state) => ({
@@ -126,6 +129,7 @@ const mapDispatchToProps = {
126129
getProfile: actions.myGigs.getProfile,
127130
// getStatuses: actions.lookup.getGigStatuses,
128131
updateProfile: actions.myGigs.updateProfile,
132+
getAllCountries: actions.lookup.getAllCountries,
129133
};
130134

131135
export default connect(mapStateToProps, mapDispatchToProps)(MyGigs);

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ const UpdateGigProfile = ({
118118

119119
const onSubmitProfile = () => {
120120
const update = varsRef.current.profileEdit;
121+
if (!update.countryName) {
122+
const selectedCountry = countries.find(
123+
(country) => country.countryCode === update.country
124+
);
125+
update.countryName = selectedCountry.name;
126+
}
121127
delete update.fileError;
122128
onSubmit(update);
123129
};
@@ -155,11 +161,10 @@ const UpdateGigProfile = ({
155161
const country = countries.find(
156162
(country) => selectedOption.label === country.name
157163
);
158-
159164
setProfileEdit({
160165
...varsRef.current.profileEdit,
161-
country: selectedOption.label,
162-
countryCode: country.countryCode,
166+
country: country.countryCode,
167+
countryName: country.name
163168
});
164169
setPristine(false);
165170
};

src/services/myGigs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ async function getProfile() {
130130
async function updateProfile(profile) {
131131
const payload = {
132132
city: profile.city,
133-
country: profile.countryCode,
134-
countryName: profile.country,
133+
country: profile.country,
134+
countryName: profile.countryName,
135135
phone: profile.phone,
136136
availability: profile.status === GIG_STATUS.AVAILABLE ? true : false,
137137
resume: profile.file,

0 commit comments

Comments
 (0)