Skip to content

Commit 2fffc18

Browse files
committed
fix: wip memberid out of scope error
1 parent 1dbb552 commit 2fffc18

File tree

5 files changed

+31
-23
lines changed

5 files changed

+31
-23
lines changed

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

config/default.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module.exports = {
6161
"9ecc88e5-a4ee-44a4-8ec1-70bd98022510": 123789456,
6262
"d6d31f34-8ee5-4589-ae65-45652fcc01a6": 30000720,
6363
},
64-
GRPC_CHALLENGE_SERVER_HOST:
65-
process.env.GRPC_CHALLENGE_SERVER_HOST || "localhost",
66-
GRPC_CHALLENGE_SERVER_PORT: process.env.GRPC_CHALLENGE_SERVER_PORT || 9092,
64+
GRPC_SUBMISSION_SERVER_HOST:
65+
process.env.GRPC_SUBMISSION_SERVER_HOST || "localhost",
66+
GRPC_SUBMISSION_SERVER_PORT: process.env.GRPC_SUBMISSION_SERVER_PORT || 9092,
6767
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"dependencies": {
3030
"@elastic/elasticsearch": "^8.6.0",
31-
"@topcoder-framework/domain-submission": "^v0.4.18-ci.0",
31+
"@topcoder-framework/domain-submission": "0.5.4-ci.0",
3232
"@topcoder-framework/lib-common": "^v0.4.18-ci.0",
3333
"amazon-s3-uri": "0.0.3",
3434
"aws-sdk": "^2.265.1",

src/services/SubmissionService.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ const {
2424
const { SubmissionDomain } = require("@topcoder-framework/domain-submission");
2525

2626
const submissionDomain = new SubmissionDomain(
27-
config.GRPC_CHALLENGE_SERVER_HOST,
28-
config.GRPC_CHALLENGE_SERVER_PORT
27+
config.GRPC_SUBMISSION_SERVER_HOST,
28+
config.GRPC_SUBMISSION_SERVER_PORT
2929
);
3030

3131
const table = "Submission";
@@ -361,24 +361,19 @@ async function createSubmission(authUser, files, entity) {
361361

362362
// Submission api only works with legacy challenge id
363363
// If it is a v5 challenge id, get the associated legacy challenge id
364+
//TODO: move this to domain layer
364365
const challengeId = await helper.getV5ChallengeId(entity.challengeId);
365366
const legacyChallengeId = await helper.getLegacyChallengeId(
366367
entity.challengeId
367368
);
368369
const currDate = new Date().getTime();
369370

370371
const item = {
371-
id: submissionId,
372372
challengeId,
373-
createdBy: authUser.handle || authUser.sub,
374-
fileType: "",
375-
memberId: entity.memberId,
376-
submittedDate: currDate,
373+
fileType: entity.fileType || fileType,
377374
type: entity.type,
378-
updatedBy: authUser.handle || authUser.sub,
375+
// memberId: +entity.memberId,
379376
url: url,
380-
created: currDate,
381-
updated: currDate,
382377
};
383378

384379
// Pure v5 challenges won't have a legacy challenge id
@@ -429,8 +424,8 @@ async function createSubmission(authUser, files, entity) {
429424
);
430425
}
431426

432-
item.submittedDate = new Date(entity.submittedDate || item.created).getTime();
433-
item.createdBy = entity.createdBy || "";
427+
// item.submittedDate = new Date(entity.submittedDate || item.created).getTime();
428+
// item.createdBy = entity.createdBy || "";
434429

435430
if (!item.submissionPhaseId) {
436431
delete item.submissionPhaseId;

yarn.lock

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -473,16 +473,26 @@
473473
resolved "http://localhost:4873/@tootallnate%2fonce/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
474474
integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==
475475

476-
"@topcoder-framework/domain-submission@^v0.4.18-ci.0":
477-
version "0.4.18-ci.0"
478-
resolved "http://localhost:4873/@topcoder-framework%2fdomain-submission/-/domain-submission-0.4.18-ci.0.tgz#91005f80e26fad6a62e2fc206a19e052f544f101"
479-
integrity sha512-laav/vrkWxY/2DxNX78rXrh8hnlhRrwurw3OujfOIbqLFvK8+/xrVCic1zDoBsete3eU8UeeLBqFU1xJNFQHhQ==
476+
"@topcoder-framework/domain-submission@0.5.4-ci.0":
477+
version "0.5.4-ci.0"
478+
resolved "https://topcoder-409275337247.d.codeartifact.us-east-1.amazonaws.com:443/npm/topcoder-framework/@topcoder-framework/domain-submission/-/domain-submission-0.5.4-ci.0.tgz#37464c4aefdfc9eb20a5a2d04cf0e70913a16968"
479+
integrity sha512-nL84kUE2+gDQzrEK6/AnMre2O9JQAOh/CcvnlHilMAfvZGvwoHelNyJV4EXkn7hXv7a8fYDTJKTfXd5cB7QI6g==
480480
dependencies:
481-
"@topcoder-framework/lib-common" "^0.2.1"
481+
"@topcoder-framework/lib-common" "0.5.4-ci.0"
482482
dotenv "^16.0.3"
483483
tslib "^2.4.1"
484484

485-
"@topcoder-framework/lib-common@^0.2.1", "@topcoder-framework/lib-common@^v0.4.18-ci.0":
485+
"@topcoder-framework/lib-common@0.5.4-ci.0":
486+
version "0.5.4-ci.0"
487+
resolved "https://topcoder-409275337247.d.codeartifact.us-east-1.amazonaws.com:443/npm/topcoder-framework/@topcoder-framework/lib-common/-/lib-common-0.5.4-ci.0.tgz#e0ed57df5dd0a2efdbac484749c2e3fd06808105"
488+
integrity sha512-ikgnb6DYDUP3wGzmGB9bvATllw7RsLJzoYO0H2QHiBKBe5yyjS5t9S9BzqV8dyTlSekg4B9nhwiYY9X1Z4kwaQ==
489+
dependencies:
490+
"@grpc/grpc-js" "^1.8.0"
491+
rimraf "^3.0.2"
492+
topcoder-interface "github:topcoder-platform/plat-interface-definition#v0.0.20"
493+
tslib "^2.4.1"
494+
495+
"@topcoder-framework/lib-common@^v0.4.18-ci.0":
486496
version "0.4.18-ci.0"
487497
resolved "http://localhost:4873/@topcoder-framework%2flib-common/-/lib-common-0.4.18-ci.0.tgz#aa2cfad142fc6507035a405585b61a8c3c00a2d1"
488498
integrity sha512-yE3xAjWU1/MZYuJn8QT8/iepkMjH5T9/Ctyim1alHae/OP5l9RkpidZVuLdxm8MXHQDmERWCzNWn/O1YLuwBgw==
@@ -6732,6 +6742,10 @@ toidentifier@1.0.1:
67326742
version "1.0.0"
67336743
resolved "https://codeload.github.com/topcoder-platform/plat-interface-definition/tar.gz/83db3ad5ac053393f8d9aa975dfe067fd8942add"
67346744

6745+
"topcoder-interface@github:topcoder-platform/plat-interface-definition#v0.0.20":
6746+
version "1.0.0"
6747+
resolved "https://codeload.github.com/topcoder-platform/plat-interface-definition/tar.gz/7f80c4abb46660eb5cff15dfd57b4515b7d49870"
6748+
67356749
topo@3.x.x:
67366750
version "3.0.3"
67376751
resolved "http://localhost:4873/topo/-/topo-3.0.3.tgz#d5a67fb2e69307ebeeb08402ec2a2a6f5f7ad95c"

0 commit comments

Comments
 (0)