From 4fc65dfaffc574a4c514d0d4728285978856a4ba Mon Sep 17 00:00:00 2001 From: Sachin Maheshwari Date: Tue, 2 Mar 2021 20:15:05 +0530 Subject: [PATCH 1/4] logic change for phaseId --- src/common/helper.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/helper.js b/src/common/helper.js index f3170bf9..be717ba7 100755 --- a/src/common/helper.js +++ b/src/common/helper.js @@ -376,11 +376,11 @@ function * getSubmissionPhaseId (challengeId) { const submissionPh = _.filter(phases, { name: 'Submission', isOpen: true }) const finalFixPh = _.filter(phases, { name: 'Final Fix', isOpen: true }) if (checkPoint.length !== 0) { - phaseId = checkPoint[0].id + phaseId = _.get('checkPoint[0]', 'phaseId', null) } else if (submissionPh.length !== 0) { - phaseId = submissionPh[0].id + phaseId = _.get('submissionPh[0]', 'phaseId', null) } else if (finalFixPh.length !== 0) { - phaseId = finalFixPh[0].id + phaseId = _.get('finalFixPh[0]', 'phaseId', null) } } return phaseId From b1e2fafb946e4929450df4b85fc6c41e164e9638 Mon Sep 17 00:00:00 2001 From: Sachin Maheshwari Date: Tue, 2 Mar 2021 20:31:08 +0530 Subject: [PATCH 2/4] typo --- src/common/helper.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/helper.js b/src/common/helper.js index be717ba7..b1fa823e 100755 --- a/src/common/helper.js +++ b/src/common/helper.js @@ -376,11 +376,11 @@ function * getSubmissionPhaseId (challengeId) { const submissionPh = _.filter(phases, { name: 'Submission', isOpen: true }) const finalFixPh = _.filter(phases, { name: 'Final Fix', isOpen: true }) if (checkPoint.length !== 0) { - phaseId = _.get('checkPoint[0]', 'phaseId', null) + phaseId = _.get(checkPoint, "[0].phaseId", null) } else if (submissionPh.length !== 0) { - phaseId = _.get('submissionPh[0]', 'phaseId', null) + phaseId = _.get(submissionPh, "[0].phaseId", null) } else if (finalFixPh.length !== 0) { - phaseId = _.get('finalFixPh[0]', 'phaseId', null) + phaseId = _.get(finalFixPh, "[0].phaseId", null) } } return phaseId From b34e69c8f64a399439c34882e67bf585fd11a2a2 Mon Sep 17 00:00:00 2001 From: Sachin Maheshwari Date: Tue, 2 Mar 2021 20:41:25 +0530 Subject: [PATCH 3/4] typo --- src/common/helper.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/helper.js b/src/common/helper.js index b1fa823e..cc4cdaf6 100755 --- a/src/common/helper.js +++ b/src/common/helper.js @@ -376,11 +376,11 @@ function * getSubmissionPhaseId (challengeId) { const submissionPh = _.filter(phases, { name: 'Submission', isOpen: true }) const finalFixPh = _.filter(phases, { name: 'Final Fix', isOpen: true }) if (checkPoint.length !== 0) { - phaseId = _.get(checkPoint, "[0].phaseId", null) + phaseId = checkPoint[0].phaseId } else if (submissionPh.length !== 0) { - phaseId = _.get(submissionPh, "[0].phaseId", null) + phaseId = submissionPh[0].phaseId } else if (finalFixPh.length !== 0) { - phaseId = _.get(finalFixPh, "[0].phaseId", null) + phaseId = finalFixPh[0].phaseId } } return phaseId From a22591576861a74077c9265c711571beab8474cc Mon Sep 17 00:00:00 2001 From: Sachin Maheshwari Date: Tue, 2 Mar 2021 23:31:49 +0530 Subject: [PATCH 4/4] correcting phaseid mapping --- src/common/helper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/helper.js b/src/common/helper.js index cc4cdaf6..c6f91ed5 100755 --- a/src/common/helper.js +++ b/src/common/helper.js @@ -459,7 +459,7 @@ function * checkCreateAccess (authUser, subEntity) { throw new errors.HttpStatusError(403, 'You are not allowed to submit when submission phase is not open') } - const currPhase = _.filter(phases, { id: submissionPhaseId }) + const currPhase = _.filter(phases, { phaseId: submissionPhaseId }) if (currPhase[0].name === 'Final Fix') { if (!authUser.handle.equals(winner[0].handle)) {