aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-09-19 10:16:44 +0200
committerChocobozzz <me@florianbigard.com>2018-09-19 10:20:38 +0200
commit96f29c0f6d2e623fb088e88200934c5df8da9924 (patch)
treef11e52c12f56733bef70ac7bbde5179c5a5ecc40 /server/helpers/custom-validators
parentad76628b17ff8f25d3402d6d669b274116bbf76c (diff)
downloadPeerTube-96f29c0f6d2e623fb088e88200934c5df8da9924.tar.gz
PeerTube-96f29c0f6d2e623fb088e88200934c5df8da9924.tar.zst
PeerTube-96f29c0f6d2e623fb088e88200934c5df8da9924.zip
Optimize SQL requests of videos AP endpoints
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/videos.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts
index dd207c787..c9ef8445d 100644
--- a/server/helpers/custom-validators/videos.ts
+++ b/server/helpers/custom-validators/videos.ts
@@ -152,7 +152,8 @@ function checkUserCanManageVideo (user: UserModel, video: VideoModel, right: Use
152 return true 152 return true
153} 153}
154 154
155async function isVideoExist (id: string, res: Response, fetchType: 'all' | 'only-video' | 'id' | 'none' = 'all') { 155export type VideoFetchType = 'all' | 'only-video' | 'id' | 'none'
156async function isVideoExist (id: string, res: Response, fetchType: VideoFetchType = 'all') {
156 let video: VideoModel | null 157 let video: VideoModel | null
157 158
158 if (fetchType === 'all') { 159 if (fetchType === 'all') {