diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-19 10:16:44 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-09-19 10:20:38 +0200 |
commit | 96f29c0f6d2e623fb088e88200934c5df8da9924 (patch) | |
tree | f11e52c12f56733bef70ac7bbde5179c5a5ecc40 /server/helpers/custom-validators/videos.ts | |
parent | ad76628b17ff8f25d3402d6d669b274116bbf76c (diff) | |
download | PeerTube-96f29c0f6d2e623fb088e88200934c5df8da9924.tar.gz PeerTube-96f29c0f6d2e623fb088e88200934c5df8da9924.tar.zst PeerTube-96f29c0f6d2e623fb088e88200934c5df8da9924.zip |
Optimize SQL requests of videos AP endpoints
Diffstat (limited to 'server/helpers/custom-validators/videos.ts')
-rw-r--r-- | server/helpers/custom-validators/videos.ts | 3 |
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 | ||
155 | async function isVideoExist (id: string, res: Response, fetchType: 'all' | 'only-video' | 'id' | 'none' = 'all') { | 155 | export type VideoFetchType = 'all' | 'only-video' | 'id' | 'none' |
156 | async 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') { |