From 57a49263e48739c31cd339730ac4cb24e3d5d723 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Sun, 7 Jan 2018 14:48:10 +0100 Subject: A few updates for the watch video view (#181) * Fixes #156: Filter out the video being watched from the list of other videos of the same author; * Fixes #167: in the video view, hide the author's domain when it's from the current host; * Fixes #171: Allow undoing a like/dislike; --- server/controllers/api/videos/rate.ts | 1 - server/helpers/custom-validators/videos.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'server') 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) { await previousRate.destroy({ transaction: t }) } else { // Update previous rate previousRate.type = rateType - await previousRate.save({ transaction: t }) } } 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) { } function isVideoRatingTypeValid (value: string) { - return values(VIDEO_RATE_TYPES).indexOf(value as VideoRateType) !== -1 + return value === 'none' || values(VIDEO_RATE_TYPES).indexOf(value as VideoRateType) !== -1 } function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) { -- cgit v1.2.3