From ca3880902bcb66cf13f7ba6e22171e98df8ddf1b Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Fri, 17 May 2024 16:18:41 +1000 Subject: [PATCH 1/3] Debugging for review types --- src/common/helper.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/helper.js b/src/common/helper.js index 4f76b9a..17c69b7 100755 --- a/src/common/helper.js +++ b/src/common/helper.js @@ -125,13 +125,13 @@ async function getReviewTypes () { */ async function getReviewTypeId (scorecardName) { const reviewTypes = await getReviewTypes() - logger.info(`Review types: ${JSON.stringify(reviewTypes, null, 5)}`) - logger.info(`Looking for: ${scorecardName}`) for (const reviewType of reviewTypes) { if (reviewType.name === scorecardName) { + logger.info(`Looking for: ${scorecardName}, found: ${JSON.stringify(reviewType, null, 4)}`) return reviewType.id } } + logger.info(`Looking for: ${scorecardName}, found NO MATCH`) return null } From fa12f11cf040e7c7fccaa12ddc4f4c0c2a8cd2cb Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Fri, 17 May 2024 16:23:24 +1000 Subject: [PATCH 2/3] Logging update --- src/common/informixHelper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/informixHelper.js b/src/common/informixHelper.js index 232c53c..eb34499 100644 --- a/src/common/informixHelper.js +++ b/src/common/informixHelper.js @@ -77,8 +77,8 @@ async function loadOnlineReviewDetails (authUser, submission) { } // Adds the review summation to DynamoDB - logger.info(`Creating review summation: ${JSON.stringify(reviewSummation, null, 4)}`) if (reviewSummation) { + logger.info(`Creating review summation: ${JSON.stringify(reviewSummation, null, 4)}`) await ReviewSummationService.createReviewSummation(authUser, reviewSummation) } } From 267a91ed4f81f878097e30bbb786d5c79eb9f0bb Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Fri, 17 May 2024 16:39:33 +1000 Subject: [PATCH 3/3] Minor cleanup --- src/services/SubmissionService.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/services/SubmissionService.js b/src/services/SubmissionService.js index c188b18..c9f7c1e 100755 --- a/src/services/SubmissionService.js +++ b/src/services/SubmissionService.js @@ -222,6 +222,11 @@ downloadSubmission.schema = joi.object({ * @return {Promise} Data fetched from ES */ async function listSubmissions (authUser, query) { + let loadLegacy = false + if (query.loadLegacy) { + loadLegacy = true + delete query.loadLegacy + } if (query.challengeId) { // Submission api now only works with v5 challenge id // If it is a legacy challenge id, get the associated v5 challenge id @@ -266,7 +271,7 @@ async function listSubmissions (authUser, query) { // services. We can't do that here because it would introduce a circular dependency because the // review service calls back to the submission service (this file) // The check for submission.legacyId is for Phoenix submissions - we won't necessarily have the ID for those. - if (!hasReviewInES && submission.id && submission.legacySubmissionId && query.loadLegacy) { + if (!hasReviewInES && submission.id && submission.legacySubmissionId && loadLegacy) { await informixHelper.loadOnlineReviewDetails(authUser, submission) }