PeerTube/middlewares/reqValidators/pods.js

24 lines
630 B
JavaScript
Raw Normal View History

2015-11-07 07:16:26 -06:00
;(function () {
'use strict'
var checkErrors = require('./utils').checkErrors
2016-01-30 10:05:22 -06:00
var logger = require('../../helpers/logger')
2015-11-07 07:16:26 -06:00
2016-01-31 04:23:52 -06:00
var reqValidatorsPod = {
podsAdd: podsAdd
}
2015-11-07 07:16:26 -06:00
2016-01-31 04:23:52 -06:00
function podsAdd (req, res, next) {
2015-11-07 07:16:26 -06: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 04:23:52 -06:00
// ---------------------------------------------------------------------------
module.exports = reqValidatorsPod
2015-11-07 07:16:26 -06:00
})()