aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/video-channels.ts
diff options
context:
space:
mode:
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) {