Add shares forward and collection on videos/video channels
This commit is contained in:
parent
74bb2cb834
commit
4e50b6a1c9
29 changed files with 546 additions and 133 deletions
|
@ -14,8 +14,22 @@ function checkErrors (req: express.Request, res: express.Response, next: express
|
|||
return next()
|
||||
}
|
||||
|
||||
function areValidationErrors (req: express.Request, res: express.Response) {
|
||||
const errors = validationResult(req)
|
||||
|
||||
if (!errors.isEmpty()) {
|
||||
logger.warn('Incorrect request parameters', { path: req.originalUrl, err: errors.mapped() })
|
||||
res.status(400).json({ errors: errors.mapped() })
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
checkErrors
|
||||
checkErrors,
|
||||
areValidationErrors
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue