diff options
Diffstat (limited to 'server/helpers/custom-validators/video-channels.ts')
-rw-r--r-- | server/helpers/custom-validators/video-channels.ts | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/server/helpers/custom-validators/video-channels.ts b/server/helpers/custom-validators/video-channels.ts index f818ce8f1..0471f6ec4 100644 --- a/server/helpers/custom-validators/video-channels.ts +++ b/server/helpers/custom-validators/video-channels.ts | |||
@@ -20,33 +20,12 @@ function isVideoChannelSupportValid (value: string) { | |||
20 | return value === null || (exists(value) && validator.isLength(value, VIDEO_CHANNELS_CONSTRAINTS_FIELDS.SUPPORT)) | 20 | return value === null || (exists(value) && validator.isLength(value, VIDEO_CHANNELS_CONSTRAINTS_FIELDS.SUPPORT)) |
21 | } | 21 | } |
22 | 22 | ||
23 | async function doesLocalVideoChannelNameExist (name: string, res: express.Response) { | ||
24 | const videoChannel = await VideoChannelModel.loadLocalByNameAndPopulateAccount(name) | ||
25 | |||
26 | return processVideoChannelExist(videoChannel, res) | ||
27 | } | ||
28 | |||
29 | async function doesVideoChannelIdExist (id: number, res: express.Response) { | ||
30 | const videoChannel = await VideoChannelModel.loadAndPopulateAccount(+id) | ||
31 | |||
32 | return processVideoChannelExist(videoChannel, res) | ||
33 | } | ||
34 | |||
35 | async function doesVideoChannelNameWithHostExist (nameWithDomain: string, res: express.Response) { | ||
36 | const videoChannel = await VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithDomain) | ||
37 | |||
38 | return processVideoChannelExist(videoChannel, res) | ||
39 | } | ||
40 | |||
41 | // --------------------------------------------------------------------------- | 23 | // --------------------------------------------------------------------------- |
42 | 24 | ||
43 | export { | 25 | export { |
44 | doesVideoChannelNameWithHostExist, | ||
45 | doesLocalVideoChannelNameExist, | ||
46 | isVideoChannelDescriptionValid, | 26 | isVideoChannelDescriptionValid, |
47 | isVideoChannelNameValid, | 27 | isVideoChannelNameValid, |
48 | isVideoChannelSupportValid, | 28 | isVideoChannelSupportValid, |
49 | doesVideoChannelIdExist | ||
50 | } | 29 | } |
51 | 30 | ||
52 | function processVideoChannelExist (videoChannel: VideoChannelModel, res: express.Response) { | 31 | function processVideoChannelExist (videoChannel: VideoChannelModel, res: express.Response) { |