Skip to content

Commit 267a91e

Browse files
committed
Minor cleanup
1 parent fa12f11 commit 267a91e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/services/SubmissionService.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ downloadSubmission.schema = joi.object({
222222
* @return {Promise<Object>} Data fetched from ES
223223
*/
224224
async function listSubmissions (authUser, query) {
225+
let loadLegacy = false
226+
if (query.loadLegacy) {
227+
loadLegacy = true
228+
delete query.loadLegacy
229+
}
225230
if (query.challengeId) {
226231
// Submission api now only works with v5 challenge id
227232
// If it is a legacy challenge id, get the associated v5 challenge id
@@ -266,7 +271,7 @@ async function listSubmissions (authUser, query) {
266271
// services. We can't do that here because it would introduce a circular dependency because the
267272
// review service calls back to the submission service (this file)
268273
// The check for submission.legacyId is for Phoenix submissions - we won't necessarily have the ID for those.
269-
if (!hasReviewInES && submission.id && submission.legacySubmissionId && query.loadLegacy) {
274+
if (!hasReviewInES && submission.id && submission.legacySubmissionId && loadLegacy) {
270275
await informixHelper.loadOnlineReviewDetails(authUser, submission)
271276
}
272277

0 commit comments

Comments
 (0)