From 9e167724f7e933f41d9ea2e1c31772bf4c560a28 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 21 Feb 2017 21:35:59 +0100 Subject: Server: make a basic "quick and dirty update" for videos This system will be useful to to update some int video attributes (likes, dislikes, views...) The classic system is not used because we need some optimization for scaling --- server/middlewares/validators/remote/videos.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'server/middlewares') diff --git a/server/middlewares/validators/remote/videos.js b/server/middlewares/validators/remote/videos.js index cf9925b6c..ddc274c45 100644 --- a/server/middlewares/validators/remote/videos.js +++ b/server/middlewares/validators/remote/videos.js @@ -4,7 +4,8 @@ const checkErrors = require('../utils').checkErrors const logger = require('../../../helpers/logger') const validatorsRemoteVideos = { - remoteVideos + remoteVideos, + remoteQaduVideos } function remoteVideos (req, res, next) { @@ -15,6 +16,14 @@ function remoteVideos (req, res, next) { checkErrors(req, res, next) } +function remoteQaduVideos (req, res, next) { + req.checkBody('data').isEachRemoteRequestVideosQaduValid() + + logger.debug('Checking remoteVideosQadu parameters', { parameters: req.body }) + + checkErrors(req, res, next) +} + // --------------------------------------------------------------------------- module.exports = validatorsRemoteVideos -- cgit v1.2.3