aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/custom-validators/video-playlists.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/video-playlists.ts b/server/helpers/custom-validators/video-playlists.ts
index c217a39bf..e0eb423d7 100644
--- a/server/helpers/custom-validators/video-playlists.ts
+++ b/server/helpers/custom-validators/video-playlists.ts
@@ -26,8 +26,10 @@ function isVideoPlaylistTypeValid (value: any) {
26 return exists(value) && VIDEO_PLAYLIST_TYPES[ value ] !== undefined 26 return exists(value) && VIDEO_PLAYLIST_TYPES[ value ] !== undefined
27} 27}
28 28
29async function isVideoPlaylistExist (id: number | string, res: express.Response) { 29async function isVideoPlaylistExist (id: number | string, res: express.Response, fetchType: 'summary' | 'all' = 'summary') {
30 const videoPlaylist = await VideoPlaylistModel.loadWithAccountAndChannel(id, undefined) 30 const videoPlaylist = fetchType === 'summary'
31 ? await VideoPlaylistModel.loadWithAccountAndChannelSummary(id, undefined)
32 : await VideoPlaylistModel.loadWithAccountAndChannel(id, undefined)
31 33
32 if (!videoPlaylist) { 34 if (!videoPlaylist) {
33 res.status(404) 35 res.status(404)