1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Add peertube plugin index website models

This commit is contained in:
Chocobozzz 2019-07-15 15:41:56 +02:00 committed by Chocobozzz
parent 30ff39e7f0
commit 503c6f440a
8 changed files with 38 additions and 11 deletions

View file

@ -5,7 +5,8 @@ import { logger } from '../../helpers/logger'
import { CustomConfig } from '../../../shared/models/server/custom-config.model'
import { Emailer } from '../../lib/emailer'
import { areValidationErrors } from './utils'
import { isThemeValid } from '../../helpers/custom-validators/plugins'
import { isThemeNameValid } from '../../helpers/custom-validators/plugins'
import { isThemeRegistered } from '../../lib/plugins/theme-utils'
const customConfigUpdateValidator = [
body('instance.name').exists().withMessage('Should have a valid instance name'),
@ -48,7 +49,7 @@ const customConfigUpdateValidator = [
body('followers.instance.enabled').isBoolean().withMessage('Should have a valid followers of instance boolean'),
body('followers.instance.manualApproval').isBoolean().withMessage('Should have a valid manual approval boolean'),
body('theme.default').custom(isThemeValid).withMessage('Should have a valid theme'),
body('theme.default').custom(v => isThemeNameValid(v) && isThemeRegistered(v)).withMessage('Should have a valid theme'),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking customConfigUpdateValidator parameters', { parameters: req.body })