-function checkVideoChannelExists (id: string, res: express.Response, callback: () => void) {
- let promise: Bluebird<VideoChannelInstance>
- if (validator.isInt(id)) {
- promise = db.VideoChannel.loadAndPopulateAccount(+id)
- } else { // UUID
- promise = db.VideoChannel.loadByUUIDAndPopulateAccount(id)
- }
+function isVideoChannelSupportValid (value: string) {
+ return value === null || (exists(value) && validator.isLength(value, VIDEO_CHANNELS_CONSTRAINTS_FIELDS.SUPPORT))
+}