Skip to content

Commit ae649d2

Browse files
author
Sachin Maheshwari
committed
as per request at git-issue topcoder-platform/community-app#4108, disabling events 'A new submission is uploaded'
1 parent d70c9ee commit ae649d2

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

config/default.js

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,25 @@ module.exports = {
8181
},
8282
},
8383
],
84-
'submission.notification.create': [
85-
{
86-
handleSubmission:
87-
{
88-
resource: 'submission',
89-
roles: ['Copilot', 'Reviewer'],
90-
selfOnly: true /** Submitter only */,
91-
notification:
92-
{
93-
id: 0, /** challengeid or projectid */
94-
name: '', /** challenge name */
95-
group: 'submission',
96-
title: 'A new submission is uploaded.',
97-
},
98-
},
99-
},
100-
],
101-
'admin.notification.broadcast' : [{
84+
// /** 'submission.notification.create': [
85+
// {
86+
// handleSubmission:
87+
// {
88+
// resource: 'submission',
89+
// roles: ['Copilot', 'Reviewer'],
90+
// selfOnly: true /** Submitter only */,
91+
// notification:
92+
// {
93+
// id: 0, /** challengeid or projectid */
94+
// name: '', /** challenge name */
95+
// group: 'submission',
96+
// title: 'A new submission is uploaded.',
97+
// },
98+
// },
99+
// },
100+
// ],
101+
// */ // issue - https://github.com/topcoder-platform/community-app/issues/4108
102+
'admin.notification.broadcast': [{
102103
handleBulkNotification: {}
103104
}
104105
]
@@ -112,5 +113,5 @@ module.exports = {
112113
ENABLE_DEV_MODE: process.env.ENABLE_DEV_MODE ? Boolean(process.env.ENABLE_DEV_MODE) : true,
113114
DEV_MODE_EMAIL: process.env.DEV_MODE_EMAIL,
114115
DEFAULT_REPLY_EMAIL: process.env.DEFAULT_REPLY_EMAIL,
115-
ENABLE_HOOK_BULK_NOTIFICATION : process.env.ENABLE_HOOK_BULK_NOTIFICATION || false,
116+
ENABLE_HOOK_BULK_NOTIFICATION: process.env.ENABLE_HOOK_BULK_NOTIFICATION || false,
116117
};

src/common/broadcastAPIHelper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ async function getMemberInfo(userId) {
3232
`query=userId%3A${userId}` +
3333
`&limit=1`
3434
if (cachedMemberInfo = cache.get(url)) {
35-
return new Promise( (resolve, reject) => {
35+
return new Promise((resolve, reject) => {
3636
resolve(cachedMemberInfo)
3737
})
38-
}
38+
}
3939
return new Promise(async function (resolve, reject) {
4040
let memberInfo = []
4141
logger.info(`calling member api ${url} `)

src/hooks/hookBulkMessage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async function syncBulkMessageForUser(userId) {
7272
try {
7373
memberInfo = await api.getMemberInfo(userId)
7474
userGroupInfo = await api.getUserGroup(userId)
75-
} catch(e) {
75+
} catch (e) {
7676
reject(`${logPrefix} Failed to get member/group info: ${e}`)
7777
}
7878
Promise.all(res[0].map((r) => isBroadCastMessageForUser(userId, r, memberInfo, userGroupInfo)))

0 commit comments

Comments
 (0)