diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-02-07 11:23:23 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-02-07 11:23:23 +0100 |
commit | 9f10b2928df655c3672d9607e864e667d4bc903a (patch) | |
tree | 7743911b974b3a7fb0d4c7cec2a723942466b7f1 /middlewares/reqValidators/remote.js | |
parent | d7c01e7793d813d804a3b5716d8288f9dcf71a16 (diff) | |
download | PeerTube-9f10b2928df655c3672d9607e864e667d4bc903a.tar.gz PeerTube-9f10b2928df655c3672d9607e864e667d4bc903a.tar.zst PeerTube-9f10b2928df655c3672d9607e864e667d4bc903a.zip |
Remove useless anonymous functions of files
Diffstat (limited to 'middlewares/reqValidators/remote.js')
-rw-r--r-- | middlewares/reqValidators/remote.js | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/middlewares/reqValidators/remote.js b/middlewares/reqValidators/remote.js index 9b61481ad..88de16b49 100644 --- a/middlewares/reqValidators/remote.js +++ b/middlewares/reqValidators/remote.js | |||
@@ -1,45 +1,43 @@ | |||
1 | ;(function () { | 1 | 'use strict' |
2 | 'use strict' | ||
3 | 2 | ||
4 | var checkErrors = require('./utils').checkErrors | 3 | var checkErrors = require('./utils').checkErrors |
5 | var logger = require('../../helpers/logger') | 4 | var logger = require('../../helpers/logger') |
6 | 5 | ||
7 | var reqValidatorsRemote = { | 6 | var reqValidatorsRemote = { |
8 | remoteVideosAdd: remoteVideosAdd, | 7 | remoteVideosAdd: remoteVideosAdd, |
9 | remoteVideosRemove: remoteVideosRemove, | 8 | remoteVideosRemove: remoteVideosRemove, |
10 | secureRequest: secureRequest | 9 | secureRequest: secureRequest |
11 | } | 10 | } |
12 | 11 | ||
13 | function remoteVideosAdd (req, res, next) { | 12 | function remoteVideosAdd (req, res, next) { |
14 | req.checkBody('data').isArray() | 13 | req.checkBody('data').isArray() |
15 | req.checkBody('data').eachIsRemoteVideosAddValid() | 14 | req.checkBody('data').eachIsRemoteVideosAddValid() |
16 | 15 | ||
17 | logger.debug('Checking remoteVideosAdd parameters', { parameters: req.body }) | 16 | logger.debug('Checking remoteVideosAdd parameters', { parameters: req.body }) |
18 | 17 | ||
19 | checkErrors(req, res, next) | 18 | checkErrors(req, res, next) |
20 | } | 19 | } |
21 | 20 | ||
22 | function remoteVideosRemove (req, res, next) { | 21 | function remoteVideosRemove (req, res, next) { |
23 | req.checkBody('data').isArray() | 22 | req.checkBody('data').isArray() |
24 | req.checkBody('data').eachIsRemoteVideosRemoveValid() | 23 | req.checkBody('data').eachIsRemoteVideosRemoveValid() |
25 | 24 | ||
26 | logger.debug('Checking remoteVideosRemove parameters', { parameters: req.body }) | 25 | logger.debug('Checking remoteVideosRemove parameters', { parameters: req.body }) |
27 | 26 | ||
28 | checkErrors(req, res, next) | 27 | checkErrors(req, res, next) |
29 | } | 28 | } |
30 | 29 | ||
31 | function secureRequest (req, res, next) { | 30 | function secureRequest (req, res, next) { |
32 | req.checkBody('signature.url', 'Should have a signature url').isURL() | 31 | req.checkBody('signature.url', 'Should have a signature url').isURL() |
33 | req.checkBody('signature.signature', 'Should have a signature').notEmpty() | 32 | req.checkBody('signature.signature', 'Should have a signature').notEmpty() |
34 | req.checkBody('key', 'Should have a key').notEmpty() | 33 | req.checkBody('key', 'Should have a key').notEmpty() |
35 | req.checkBody('data', 'Should have data').notEmpty() | 34 | req.checkBody('data', 'Should have data').notEmpty() |
36 | 35 | ||
37 | logger.debug('Checking secureRequest parameters', { parameters: { data: req.body.data, keyLength: req.body.key.length } }) | 36 | logger.debug('Checking secureRequest parameters', { parameters: { data: req.body.data, keyLength: req.body.key.length } }) |
38 | 37 | ||
39 | checkErrors(req, res, next) | 38 | checkErrors(req, res, next) |
40 | } | 39 | } |
41 | 40 | ||
42 | // --------------------------------------------------------------------------- | 41 | // --------------------------------------------------------------------------- |
43 | 42 | ||
44 | module.exports = reqValidatorsRemote | 43 | module.exports = reqValidatorsRemote |
45 | })() | ||