Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/common/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ async function getReviewTypes () {
*/
async function getReviewTypeId (scorecardName) {
const reviewTypes = await getReviewTypes()
logger.info(`Review types: ${JSON.stringify(reviewTypes, null, 5)}`)
logger.info(`Looking for: ${scorecardName}`)
for (const reviewType of reviewTypes) {
if (reviewType.name === scorecardName) {
return reviewType.id
Expand Down
8 changes: 5 additions & 3 deletions src/common/informixHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ async function loadOnlineReviewDetails (authUser, submission) {

// Add the reviews created to DynamoDB
for (const review of reviewsCreated) {
console.log(JSON.stringify(review, null, 4))
await ReviewService.createReview(authUser, review)
if (review && review.typeId) {
logger.info(JSON.stringify(review, null, 4))
await ReviewService.createReview(authUser, review)
}
}

// Adds the review summation to DynamoDB
console.log(JSON.stringify(reviewSummation, null, 4))
logger.info(JSON.stringify(reviewSummation, null, 4))
if (reviewSummation) {
await ReviewSummationService.createReviewSummation(authUser, reviewSummation)
}
Expand Down