Skip to content

Commit 13b3aed

Browse files
authored
Merge pull request #8 from topcoder-platform/dev
Handle homeCountryCode flow, remove null attrib.
2 parents 26c93c4 + 0dc0c27 commit 13b3aed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/services/ProcessorService.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ function convertPayload (user) {
2929
handleLower: user.handle.toLowerCase(),
3030
email: user.email,
3131
status: user.active ? config.USER_STATES.ACTIVE : config.USER_STATES.UNVERIFIED,
32-
homeCountryCode: user.country ? user.country.code : null,
32+
homeCountryCode: user.country ? user.country.isoAlpha3Code : null,
3333
country: user.country ? user.country.name : null,
3434
copilot: user.roles ? !!_.find(user.roles, (role) => role.roleName === config.COPILOT_ROLE_NAME) : false,
3535
createdAt: user.createdAt ? toEpoch(user.createdAt) : null,
3636
createdBy: user.createdBy,
3737
updatedAt: user.modifiedAt ? toEpoch(user.modifiedAt) : null,
3838
updatedBy: user.modifiedBy
3939
}
40-
return memberProfile
40+
return _.omitBy(memberProfile, _.isNil)
4141
}
4242

4343
/**
@@ -139,7 +139,7 @@ processCreateUser.schema = {
139139
lastName: joi.string().trim().allow('').allow(null),
140140
profiles: joi.array().allow(null),
141141
status: joi.string().trim(),
142-
active: joi.boolean().allow(null),
142+
active: joi.boolean().required(),
143143
country: joi.object().allow(null),
144144
roles: joi.array().allow(null),
145145
modifiedBy: joi.string().trim().allow(null),

0 commit comments

Comments
 (0)