1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Implement support field in video and video channel

This commit is contained in:
Chocobozzz 2018-02-15 14:46:26 +01:00
parent 34cbef8c6c
commit 2422c46b27
No known key found for this signature in database
GPG key ID: 583A612D890159BE
49 changed files with 490 additions and 146 deletions

View file

@ -16,6 +16,10 @@ function isVideoChannelNameValid (value: string) {
return exists(value) && validator.isLength(value, VIDEO_CHANNELS_CONSTRAINTS_FIELDS.NAME)
}
function isVideoChannelSupportValid (value: string) {
return value === null || (exists(value) && validator.isLength(value, VIDEO_CHANNELS_CONSTRAINTS_FIELDS.SUPPORT))
}
async function isVideoChannelExist (id: string, res: express.Response) {
let videoChannel: VideoChannelModel
if (validator.isInt(id)) {
@ -41,5 +45,6 @@ async function isVideoChannelExist (id: string, res: express.Response) {
export {
isVideoChannelDescriptionValid,
isVideoChannelNameValid,
isVideoChannelSupportValid,
isVideoChannelExist
}