diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-12 17:53:50 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-13 16:50:33 +0100 |
commit | 3fd3ab2d34d512b160a5e6084d7609be7b4f4452 (patch) | |
tree | e5ca358287fca6ecacce83defcf23af1e8e9f419 /server/helpers/custom-validators/video-channels.ts | |
parent | c893d4514e6ecbf282c7985fe5f82b8acd8a1137 (diff) | |
download | PeerTube-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.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) { |