aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-channel.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-27 17:30:46 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:43:01 +0100
commita2431b7dcbc72c05101dcdbe631ff84a823aeb51 (patch)
tree09278a822905622a70ff976a75e09d99bc45639a /server/models/video/video-channel.ts
parentfcaf1e0aa84213a1b1f1b1a44a3276eae35ebe70 (diff)
downloadPeerTube-a2431b7dcbc72c05101dcdbe631ff84a823aeb51.tar.gz
PeerTube-a2431b7dcbc72c05101dcdbe631ff84a823aeb51.tar.zst
PeerTube-a2431b7dcbc72c05101dcdbe631ff84a823aeb51.zip
Refractor validators
Diffstat (limited to 'server/models/video/video-channel.ts')
-rw-r--r--server/models/video/video-channel.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.ts
index e11268b2c..54f12dce3 100644
--- a/server/models/video/video-channel.ts
+++ b/server/models/video/video-channel.ts
@@ -1,6 +1,5 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2import { isVideoChannelDescriptionValid, isVideoChannelNameValid } from '../../helpers' 2import { isVideoChannelDescriptionValid, isVideoChannelNameValid } from '../../helpers'
3import { isVideoChannelUrlValid } from '../../helpers/custom-validators/video-channels'
4import { CONSTRAINTS_FIELDS } from '../../initializers/constants' 3import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
5import { sendDeleteVideoChannel } from '../../lib/activitypub/send/send-delete' 4import { sendDeleteVideoChannel } from '../../lib/activitypub/send/send-delete'
6 5
@@ -8,6 +7,7 @@ import { addMethodsToModel, getSort } from '../utils'
8import { VideoChannelAttributes, VideoChannelInstance, VideoChannelMethods } from './video-channel-interface' 7import { VideoChannelAttributes, VideoChannelInstance, VideoChannelMethods } from './video-channel-interface'
9import { getAnnounceActivityPubUrl } from '../../lib/activitypub/url' 8import { getAnnounceActivityPubUrl } from '../../lib/activitypub/url'
10import { activityPubCollection } from '../../helpers/activitypub' 9import { activityPubCollection } from '../../helpers/activitypub'
10import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'
11 11
12let VideoChannel: Sequelize.Model<VideoChannelInstance, VideoChannelAttributes> 12let VideoChannel: Sequelize.Model<VideoChannelInstance, VideoChannelAttributes>
13let toFormattedJSON: VideoChannelMethods.ToFormattedJSON 13let toFormattedJSON: VideoChannelMethods.ToFormattedJSON
@@ -66,7 +66,7 @@ export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.Da
66 allowNull: false, 66 allowNull: false,
67 validate: { 67 validate: {
68 urlValid: value => { 68 urlValid: value => {
69 const res = isVideoChannelUrlValid(value) 69 const res = isActivityPubUrlValid(value)
70 if (res === false) throw new Error('Video channel URL is not valid.') 70 if (res === false) throw new Error('Video channel URL is not valid.')
71 } 71 }
72 } 72 }