aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/controllers/api/videos/rate.ts1
-rw-r--r--server/helpers/custom-validators/videos.ts2
2 files changed, 1 insertions, 2 deletions
diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts
index b470f27f6..a7bd570eb 100644
--- a/server/controllers/api/videos/rate.ts
+++ b/server/controllers/api/videos/rate.ts
@@ -62,7 +62,6 @@ async function rateVideo (req: express.Request, res: express.Response) {
62 await previousRate.destroy({ transaction: t }) 62 await previousRate.destroy({ transaction: t })
63 } else { // Update previous rate 63 } else { // Update previous rate
64 previousRate.type = rateType 64 previousRate.type = rateType
65
66 await previousRate.save({ transaction: t }) 65 await previousRate.save({ transaction: t })
67 } 66 }
68 } 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
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts
index 1a5fdb887..0e8a2aab2 100644
--- a/server/helpers/custom-validators/videos.ts
+++ b/server/helpers/custom-validators/videos.ts
@@ -65,7 +65,7 @@ function isVideoViewsValid (value: string) {
65} 65}
66 66
67function isVideoRatingTypeValid (value: string) { 67function isVideoRatingTypeValid (value: string) {
68 return values(VIDEO_RATE_TYPES).indexOf(value as VideoRateType) !== -1 68 return value === 'none' || values(VIDEO_RATE_TYPES).indexOf(value as VideoRateType) !== -1
69} 69}
70 70
71function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) { 71function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) {