Skip to content

broadcast hotfix for country-code logic checking #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/common/broadcastAPIHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async function filterOnMemberCondition(userId, bulkMessage, m) {
if (_.indexOf(memberSkills, s.toLowerCase()) >= 0) {
skillMatch = true
logger.info(`BroadcastMessageId: ${bulkMessage.id},` +
` '${s}' skill matached for user id ${userId}`)
` '${s}' skill matched for user id ${userId}`)
}
})
} else {
Expand Down Expand Up @@ -169,13 +169,13 @@ async function filterOnMemberCondition(userId, bulkMessage, m) {
trackMatch = true // no condition, means allow for all
}

if (countryCodes.length > 0) {
if (countryCodes && (countryCodes.length > 0)) {
const mcc = _.get(m[0], 'competitionCountryCode') // get member country code
countryCodeMatch = false
if (_.indexOf(countryCodes, mcc) >= 0) {
countryCodeMatch = true
logger.info(`BroadcastMessageId: ${bulkMessage.id},` +
` '${mcc}' country code matached for user id ${userId}`)
` '${mcc}' country code matched for user id ${userId}`)
}
} else {
countryCodeMatch = true // no codition on country code
Expand Down