1
0
Fork 0
peertube/middlewares/reqValidators/pods.js

24 lines
630 B
JavaScript
Raw Normal View History

2015-11-07 13:16:26 +00:00
;(function () {
'use strict'
var checkErrors = require('./utils').checkErrors
2016-01-30 16:05:22 +00:00
var logger = require('../../helpers/logger')
2015-11-07 13:16:26 +00:00
2016-01-31 10:23:52 +00:00
var reqValidatorsPod = {
podsAdd: podsAdd
}
2015-11-07 13:16:26 +00:00
2016-01-31 10:23:52 +00:00
function podsAdd (req, res, next) {
2015-11-07 13:16:26 +00:00
req.checkBody('data.url', 'Should have an url').notEmpty().isURL({ require_protocol: true })
req.checkBody('data.publicKey', 'Should have a public key').notEmpty()
logger.debug('Checking podsAdd parameters', { parameters: req.body })
checkErrors(req, res, next)
}
2016-01-31 10:23:52 +00:00
// ---------------------------------------------------------------------------
module.exports = reqValidatorsPod
2015-11-07 13:16:26 +00:00
})()