aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/video-channels.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-12 17:53:50 +0100
committerChocobozzz <me@florianbigard.com>2017-12-13 16:50:33 +0100
commit3fd3ab2d34d512b160a5e6084d7609be7b4f4452 (patch)
treee5ca358287fca6ecacce83defcf23af1e8e9f419 /server/helpers/custom-validators/video-channels.ts
parentc893d4514e6ecbf282c7985fe5f82b8acd8a1137 (diff)
downloadPeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.gz
PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.zst
PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.zip
Move models to typescript-sequelize
Diffstat (limited to 'server/helpers/custom-validators/video-channels.ts')
-rw-r--r--server/helpers/custom-validators/video-channels.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/helpers/custom-validators/video-channels.ts b/server/helpers/custom-validators/video-channels.ts
index 3de9f041b..6bc96bf51 100644
--- a/server/helpers/custom-validators/video-channels.ts
+++ b/server/helpers/custom-validators/video-channels.ts
@@ -2,8 +2,8 @@ import * as express from 'express'
2import 'express-validator' 2import 'express-validator'
3import 'multer' 3import 'multer'
4import * as validator from 'validator' 4import * as validator from 'validator'
5import { CONSTRAINTS_FIELDS, database as db } from '../../initializers' 5import { CONSTRAINTS_FIELDS } from '../../initializers'
6import { VideoChannelInstance } from '../../models' 6import { VideoChannelModel } from '../../models/video/video-channel'
7import { exists } from './misc' 7import { exists } from './misc'
8 8
9const VIDEO_CHANNELS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_CHANNELS 9const VIDEO_CHANNELS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_CHANNELS
@@ -17,11 +17,11 @@ function isVideoChannelNameValid (value: string) {
17} 17}
18 18
19async function isVideoChannelExist (id: string, res: express.Response) { 19async function isVideoChannelExist (id: string, res: express.Response) {
20 let videoChannel: VideoChannelInstance 20 let videoChannel: VideoChannelModel
21 if (validator.isInt(id)) { 21 if (validator.isInt(id)) {
22 videoChannel = await db.VideoChannel.loadAndPopulateAccount(+id) 22 videoChannel = await VideoChannelModel.loadAndPopulateAccount(+id)
23 } else { // UUID 23 } else { // UUID
24 videoChannel = await db.VideoChannel.loadByUUIDAndPopulateAccount(id) 24 videoChannel = await VideoChannelModel.loadByUUIDAndPopulateAccount(id)
25 } 25 }
26 26
27 if (!videoChannel) { 27 if (!videoChannel) {