diff options
Diffstat (limited to 'server/helpers/custom-validators/video-channels.ts')
-rw-r--r-- | server/helpers/custom-validators/video-channels.ts | 10 |
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' | |||
2 | import 'express-validator' | 2 | import 'express-validator' |
3 | import 'multer' | 3 | import 'multer' |
4 | import * as validator from 'validator' | 4 | import * as validator from 'validator' |
5 | import { CONSTRAINTS_FIELDS, database as db } from '../../initializers' | 5 | import { CONSTRAINTS_FIELDS } from '../../initializers' |
6 | import { VideoChannelInstance } from '../../models' | 6 | import { VideoChannelModel } from '../../models/video/video-channel' |
7 | import { exists } from './misc' | 7 | import { exists } from './misc' |
8 | 8 | ||
9 | const VIDEO_CHANNELS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_CHANNELS | 9 | const VIDEO_CHANNELS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_CHANNELS |
@@ -17,11 +17,11 @@ function isVideoChannelNameValid (value: string) { | |||
17 | } | 17 | } |
18 | 18 | ||
19 | async function isVideoChannelExist (id: string, res: express.Response) { | 19 | async 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) { |