Skip to content

Commit 0bde633

Browse files
#193 - Even for non admin users, set the new attribute value
1 parent 26ffa92 commit 0bde633

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/services/ReviewService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ function * createReview (authUser, entity) {
148148
if (entity.reviewedDate) {
149149
throw new errors.HttpStatusError(403, 'You are not allowed to set the `reviewedDate` attribute on a review')
150150
}
151-
} else {
152-
item.reviewedDate = entity.reviewedDate || item.created
153151
}
154152

153+
item.reviewedDate = entity.reviewedDate || item.created
154+
155155
// Prepare record to be inserted
156156
const record = {
157157
TableName: table,

src/services/ReviewSummationService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ function * createReviewSummation (authUser, entity) {
106106
if (entity.reviewedDate) {
107107
throw new errors.HttpStatusError(403, 'You are not allowed to set the `reviewedDate` attribute on a review summation')
108108
}
109-
} else {
110-
item.reviewedDate = entity.reviewedDate || item.created
111109
}
112110

111+
item.reviewedDate = entity.reviewedDate || item.created
112+
113113
const record = {
114114
TableName: table,
115115
Item: item

src/services/SubmissionService.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,10 @@ function * createSubmission (authUser, files, entity) {
316316
}
317317
} else {
318318
logger.info(`No need to call checkCreateAccess for ${JSON.stringify(authUser)}`)
319-
item.submittedDate = entity.submittedDate || item.created
320319
}
321320

321+
item.submittedDate = entity.submittedDate || item.created
322+
322323
// Prepare record to be inserted
323324
const record = {
324325
TableName: table,

0 commit comments

Comments
 (0)