|
@ -14,11 +14,14 @@ export async function updateScore(isCorrect, score, authorId) { |
|
|
authorID: authorId, |
|
|
authorID: authorId, |
|
|
score: score, |
|
|
score: score, |
|
|
}); |
|
|
}); |
|
|
newUserScore.save((err) => |
|
|
newUserScore.save(err => { |
|
|
err |
|
|
if (err) { |
|
|
? console.log('Error creating new user for scoring') |
|
|
log({ logger: 'db', content: `Error creating new user ${authorId} for scoring`, level: 'error' }); |
|
|
: console.log('Sucessfully created user to score.'), |
|
|
} |
|
|
); |
|
|
else { |
|
|
|
|
|
log({ logger: 'db', content: `Successfully created user ${authorId} for scoring`, level: 'debug' }); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
// TODO: Error handling
|
|
|
// TODO: Error handling
|
|
|