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

Commit f1d4801

Browse files
committed
Adding logging
1 parent c039495 commit f1d4801

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/services/challengeService.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,8 @@ async function getChallengeListingFromV4ES (legacyId) {
416416
body: {
417417
version: 'true',
418418
query: {
419-
match: {
420-
id: legacyId
419+
match_phrase: {
420+
id: _.toString(legacyId)
421421
}
422422
}
423423
}
@@ -454,8 +454,8 @@ async function getChallengeDetailFromV4ES (legacyId) {
454454
body: {
455455
version: 'true',
456456
query: {
457-
match: {
458-
id: legacyId
457+
match_phrase: {
458+
id: _.toString(legacyId)
459459
}
460460
}
461461
}
@@ -575,6 +575,7 @@ async function buildV5Challenge (legacyId, challengeListing, challengeDetails) {
575575
let taskIsAssigned = false
576576
let taskMemberId = null
577577
if (challengeListing.isTask &&
578+
challengeDetails &&
578579
challengeDetails.registrants &&
579580
challengeDetails.registrants.length >= 1) {
580581
taskIsAssigned = true

src/services/syncService.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ async function syncLegacyId (legacyId, force) {
1515
if (v5) {
1616
const v4Listing = await challengeService.getChallengeListingFromV4ES(legacyId)
1717
const v4Detail = await challengeService.getChallengeDetailFromV4ES(legacyId)
18-
// logger.warn(`v4Listing ${JSON.stringify(v4Listing)}`)
18+
logger.warn(`Sync :: v4Listing ${JSON.stringify(v4Listing)}`)
19+
logger.warn(`Sync :: v4Detail ${JSON.stringify(v4Detail)}`)
1920
try {
2021
await challengeSyncStatusService.startSync(legacyId, v4Listing.version, v4Detail.version)
2122
const { resourcesAdded, resourcesRemoved } = await processResources(legacyId, v5.id, force === true)

0 commit comments

Comments
 (0)