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

Commit 97d41f5

Browse files
committed
Still not working
1 parent f236d42 commit 97d41f5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/services/groupsService.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ async function addGroupToChallenge (challengeLegacyId, groupLegacyId) {
5959
}
6060

6161
const groupMappingExists = await groupEligbilityExists(connection, eligibilityId, groupLegacyId)
62-
if (!groupMappingExists) {
63-
await createGroupEligibilityRecord(connection, eligibilityId, groupLegacyId)
62+
if (groupMappingExists) {
63+
logger.warn(`Group Relation Already Exists for ${groupMappingExists} - ${eligibilityId} ${groupLegacyId}`)
6464
} else {
65-
logger.warn(`Group Relation Already Exists for ${eligibilityId} ${groupLegacyId}`)
65+
await createGroupEligibilityRecord(connection, eligibilityId, groupLegacyId)
6666
}
6767

6868
await connection.commitTransactionAsync()
@@ -130,6 +130,7 @@ async function getChallengeEligibilityId (connection, challengeLegacyId) {
130130
* @returns {Object} DB Result
131131
*/
132132
async function groupEligbilityExists (connection, eligibilityId, groupLegacyId) {
133+
logger.debug(`groupEligibiltyExists query ${util.format(QUERY_GET_GROUP_ELIGIBILITY_ID, eligibilityId, groupLegacyId)}`)
133134
return connection.queryAsync(util.format(QUERY_GET_GROUP_ELIGIBILITY_ID, eligibilityId, groupLegacyId)) || false
134135
}
135136

0 commit comments

Comments
 (0)