mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-06 07:53:54 +00:00
8d2d8ef979
* feat: add user defined translations * add refetch key for translation (#1757) --------- Co-authored-by: Alex Christoffer Rasmussen <ac@omnivox.dk>
15 lines
527 B
TypeScript
15 lines
527 B
TypeScript
import { body } from 'express-validator';
|
|
|
|
import { requestValidationFunction } from '../validation-utils/validationFunction.js';
|
|
|
|
export const validatePostCss = [body('css').isString().trim(), requestValidationFunction];
|
|
|
|
export const validatePostTranslation = [
|
|
body('translation')
|
|
.custom((v) => v != null && typeof v === 'object' && !Array.isArray(v))
|
|
.withMessage('translation must be an object (key -> string)')
|
|
.bail(),
|
|
body('translation.*').isString().trim().notEmpty(),
|
|
requestValidationFunction,
|
|
];
|