Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/common/prisma-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function convertChallengeSchemaToPrisma(currentUser, challenge) {
// reviewers
if (!_.isNil(challenge.reviewers)) {
result.reviewers = {
create: _.map(challenge.reviewers, (r) => {
create: _.map(challenge.reviewers, (r, index) => {
const reviewer = {
...auditFields,
scorecardId: String(r.scorecardId),
Expand All @@ -232,6 +232,7 @@ function convertChallengeSchemaToPrisma(currentUser, challenge) {
basePayment: _.isNil(r.basePayment) ? null : Number(r.basePayment),
incrementalPayment: _.isNil(r.incrementalPayment) ? null : Number(r.incrementalPayment),
aiWorkflowId: r.aiWorkflowId,
createdAt: new Date(Date.now() + index),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable index is used here but it is not defined within the scope of this function. Ensure that index is defined and accessible in this context, or consider passing it as a parameter if it is intended to be dynamic.

};
if (r.type) reviewer.type = _.toUpper(r.type);
if (r.phaseId) reviewer.phase = { connect: { id: r.phaseId } };
Expand Down