Fixed runtime error with invalid function

This commit is contained in:
Ceferino Patino 2022-08-11 22:06:35 -05:00
commit 831f1e17cf

View file

@ -41,10 +41,7 @@ async function EditAnswerAccepted(req, res) {
operation: 'increment',
amount: 15,
});
await User.findByOneAndUpdate(
{ username: cachedAnswer.creator },
{ $inc: { points: 15 } }
);
await User.findOneAndUpdate({ username: cachedAnswer.creator }, { $inc: { points: 15 } });
return res.sendStatus(200);
}