aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/videos/rate.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts
index 0c6a988cf..c27c61116 100644
--- a/server/controllers/api/videos/rate.ts
+++ b/server/controllers/api/videos/rate.ts
@@ -58,11 +58,11 @@ async function rateVideo (req: express.Request, res: express.Response) {
58 else if (previousRate.type === VIDEO_RATE_TYPES.DISLIKE) dislikesToIncrement-- 58 else if (previousRate.type === VIDEO_RATE_TYPES.DISLIKE) dislikesToIncrement--
59 59
60 if (rateType === 'none') { // Destroy previous rate 60 if (rateType === 'none') { // Destroy previous rate
61 await previousRate.destroy() 61 await previousRate.destroy({ transaction: t })
62 } else { // Update previous rate 62 } else { // Update previous rate
63 previousRate.type = rateType 63 previousRate.type = rateType
64 64
65 await previousRate.save() 65 await previousRate.save({ transaction: t })
66 } 66 }
67 } else if (rateType !== 'none') { // There was not a previous rate, insert a new one if there is a rate 67 } else if (rateType !== 'none') { // There was not a previous rate, insert a new one if there is a rate
68 const query = { 68 const query = {