mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-03 14:37:58 +00:00
38654f8981
* feat: quick start modal * refactor: end message is part of view settings * refactor: small tweaks and type improvements
16 lines
572 B
TypeScript
16 lines
572 B
TypeScript
import { body, validationResult } from 'express-validator';
|
|
|
|
export const eventDataSanitizer = [
|
|
body('title').optional().isString().trim(),
|
|
body('publicUrl').optional().isString().trim(),
|
|
body('publicInfo').optional().isString().trim(),
|
|
body('backstageUrl').optional().isString().trim(),
|
|
body('backstageInfo').optional().isString().trim(),
|
|
body('endMessage').optional().isString().trim(),
|
|
(req, res, next) => {
|
|
const errors = validationResult(req);
|
|
if (!errors.isEmpty()) return res.status(422).json({ errors: errors.array() });
|
|
next();
|
|
},
|
|
];
|