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)
}
function processVideoChannelExist (videoChannel: VideoChannelModel, res: express.Response) {
if (!videoChannel) {
- res.status(404)
- .json({ error: 'Video channel not found' })
- .end()
+ ``
return false
}