]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/video-channels.ts
Refactor middleware helpers
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / video-channels.ts
index f818ce8f1acc2052b2a30eb50c586a8eeab818dd..0471f6ec4422c48ee374038b63738ff0e6dd13c7 100644 (file)
@@ -20,33 +20,12 @@ function isVideoChannelSupportValid (value: string) {
   return value === null || (exists(value) && validator.isLength(value, VIDEO_CHANNELS_CONSTRAINTS_FIELDS.SUPPORT))
 }
 
-async function doesLocalVideoChannelNameExist (name: string, res: express.Response) {
-  const videoChannel = await VideoChannelModel.loadLocalByNameAndPopulateAccount(name)
-
-  return processVideoChannelExist(videoChannel, res)
-}
-
-async function doesVideoChannelIdExist (id: number, res: express.Response) {
-  const videoChannel = await VideoChannelModel.loadAndPopulateAccount(+id)
-
-  return processVideoChannelExist(videoChannel, res)
-}
-
-async function doesVideoChannelNameWithHostExist (nameWithDomain: string, res: express.Response) {
-  const videoChannel = await VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithDomain)
-
-  return processVideoChannelExist(videoChannel, res)
-}
-
 // ---------------------------------------------------------------------------
 
 export {
-  doesVideoChannelNameWithHostExist,
-  doesLocalVideoChannelNameExist,
   isVideoChannelDescriptionValid,
   isVideoChannelNameValid,
   isVideoChannelSupportValid,
-  doesVideoChannelIdExist
 }
 
 function processVideoChannelExist (videoChannel: VideoChannelModel, res: express.Response) {