aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-28 11:14:26 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-03-18 11:17:59 +0100
commit07b1a18aa678d260009a93e36606c5c5f585723d (patch)
tree27a399fa0f7a29a7ac1d7d7cf077a24ea6ee39de /server/helpers/custom-validators
parent418d092afa81e2c8fe8ac6838fc4b5eb0af6a782 (diff)
downloadPeerTube-07b1a18aa678d260009a93e36606c5c5f585723d.tar.gz
PeerTube-07b1a18aa678d260009a93e36606c5c5f585723d.tar.zst
PeerTube-07b1a18aa678d260009a93e36606c5c5f585723d.zip
Add playlist check param tests
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/video-channels.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/helpers/custom-validators/video-channels.ts b/server/helpers/custom-validators/video-channels.ts
index cbf150e53..3792bbdcc 100644
--- a/server/helpers/custom-validators/video-channels.ts
+++ b/server/helpers/custom-validators/video-channels.ts
@@ -26,12 +26,12 @@ async function isLocalVideoChannelNameExist (name: string, res: express.Response
26 return processVideoChannelExist(videoChannel, res) 26 return processVideoChannelExist(videoChannel, res)
27} 27}
28 28
29async function isVideoChannelIdExist (id: string, res: express.Response) { 29async function isVideoChannelIdExist (id: number | string, res: express.Response) {
30 let videoChannel: VideoChannelModel 30 let videoChannel: VideoChannelModel
31 if (validator.isInt(id)) { 31 if (validator.isInt('' + id)) {
32 videoChannel = await VideoChannelModel.loadAndPopulateAccount(+id) 32 videoChannel = await VideoChannelModel.loadAndPopulateAccount(+id)
33 } else { // UUID 33 } else { // UUID
34 videoChannel = await VideoChannelModel.loadByUUIDAndPopulateAccount(id) 34 videoChannel = await VideoChannelModel.loadByUUIDAndPopulateAccount('' + id)
35 } 35 }
36 36
37 return processVideoChannelExist(videoChannel, res) 37 return processVideoChannelExist(videoChannel, res)