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

Server: Bulk update videos support field

This commit is contained in:
Chocobozzz 2019-05-31 16:30:11 +02:00
parent 9977c12838
commit 7d14d4d2ca
No known key found for this signature in database
GPG key ID: 583A612D890159BE
11 changed files with 154 additions and 32 deletions

View file

@ -14,6 +14,7 @@ import { VideoChannelModel } from '../../../models/video/video-channel'
import { areValidationErrors } from '../utils'
import { isActorPreferredUsernameValid } from '../../../helpers/custom-validators/activitypub/actor'
import { ActorModel } from '../../../models/activitypub/actor'
import { isBooleanValid } from '../../../helpers/custom-validators/misc'
const videoChannelsAddValidator = [
body('name').custom(isActorPreferredUsernameValid).withMessage('Should have a valid channel name'),
@ -40,9 +41,18 @@ const videoChannelsAddValidator = [
const videoChannelsUpdateValidator = [
param('nameWithHost').exists().withMessage('Should have an video channel name with host'),
body('displayName').optional().custom(isVideoChannelNameValid).withMessage('Should have a valid display name'),
body('description').optional().custom(isVideoChannelDescriptionValid).withMessage('Should have a valid description'),
body('support').optional().custom(isVideoChannelSupportValid).withMessage('Should have a valid support text'),
body('displayName')
.optional()
.custom(isVideoChannelNameValid).withMessage('Should have a valid display name'),
body('description')
.optional()
.custom(isVideoChannelDescriptionValid).withMessage('Should have a valid description'),
body('support')
.optional()
.custom(isVideoChannelSupportValid).withMessage('Should have a valid support text'),
body('bulkVideosSupportUpdate')
.optional()
.custom(isBooleanValid).withMessage('Should have a valid bulkVideosSupportUpdate boolean field'),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking videoChannelsUpdate parameters', { parameters: req.body })