Skip to content

Commit 35cc624

Browse files
Merge pull request #2253 from liqiang372/trim-optional-fields
Ticket #2168- Trim optional fields in user profile settings
2 parents db6ded6 + 21b8587 commit 35cc624

File tree

1 file changed

+6
-0
lines changed
  • src/shared/components/Settings/Profile/BasicInfo

1 file changed

+6
-0
lines changed

src/shared/components/Settings/Profile/BasicInfo/index.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ export default class BasicInfo extends ConsentComponent {
212212
newBasicInfo.tshirtSize = null;
213213
}
214214

215+
_.forEach(newBasicInfo.addresses[0], (value, key) => {
216+
newBasicInfo.addresses[0][key] = _.trim(value);
217+
});
218+
_.forEach(['currentLocation', 'primaryInterestInTopcoder', 'description'], (key) => {
219+
newBasicInfo[key] = _.trim(newBasicInfo[key]);
220+
});
215221
// This is a hack to check if the user has an existing basic_info trait object
216222
const exists = await this.onCheckUserTrait('basic_info');
217223
if (exists) {

0 commit comments

Comments
 (0)