mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Optimize SQL requests of videos AP endpoints
This commit is contained in:
parent
ad76628b17
commit
96f29c0f6d
7 changed files with 56 additions and 44 deletions
|
@ -152,7 +152,8 @@ function checkUserCanManageVideo (user: UserModel, video: VideoModel, right: Use
|
|||
return true
|
||||
}
|
||||
|
||||
async function isVideoExist (id: string, res: Response, fetchType: 'all' | 'only-video' | 'id' | 'none' = 'all') {
|
||||
export type VideoFetchType = 'all' | 'only-video' | 'id' | 'none'
|
||||
async function isVideoExist (id: string, res: Response, fetchType: VideoFetchType = 'all') {
|
||||
let video: VideoModel | null
|
||||
|
||||
if (fetchType === 'all') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue