import 'express-validator'
import 'multer'
import * as validator from 'validator'
-import { CONFIG, CONSTRAINTS_FIELDS } from '../../initializers'
+import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
import { VideoChannelModel } from '../../models/video/video-channel'
import { exists } from './misc'
return processVideoChannelExist(videoChannel, res)
}
-async function doesVideoChannelIdExist (id: number | string, res: express.Response) {
- let videoChannel: VideoChannelModel
- if (validator.isInt('' + id)) {
- videoChannel = await VideoChannelModel.loadAndPopulateAccount(+id)
- } else { // UUID
- videoChannel = await VideoChannelModel.loadByUUIDAndPopulateAccount('' + id)
- }
+async function doesVideoChannelIdExist (id: number, res: express.Response) {
+ const videoChannel = await VideoChannelModel.loadAndPopulateAccount(+id)
return processVideoChannelExist(videoChannel, res)
}