Skip to content

Commit 5112786

Browse files
add more logging and change projectCategoryId to Int
1 parent 4f603c4 commit 5112786

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/dao/RegistrationDAO.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ FROM dual
362362
* @return the rating result
363363
*/
364364
async function getUserRating (userId, phaseId) {
365+
logger.info(`Get user rating for user ${userId} and phase ${phaseId}`)
365366
return helper.queryDataFromDB(QUERY_GET_USER_RATING, [phaseId, userId])
366367
}
367368

@@ -541,7 +542,7 @@ async function registerComponentInquiry (userId, challengeId) {
541542
if (!compInfo) {
542543
throw new Error(`Challenge with id: ${challengeId} does not exist`)
543544
}
544-
const [userRating] = await getUserRating(userId, compInfo.projectCategoryId + 111)
545+
const [userRating] = await getUserRating(userId, parseInt(compInfo.projectCategoryId, 10) + 111)
545546
const rating = null
546547
if (userRating) {
547548
rating = userRating.rating

0 commit comments

Comments
 (0)