]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/videos.ts
Add ability to search on followers/following
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / videos.ts
index 9875c68bdfc63a120f2a7aecc27e85d236a4dee8..714f7ac956c25b8dcc35f02b716830430a131e10 100644 (file)
@@ -154,7 +154,9 @@ function checkUserCanManageVideo (user: UserModel, video: VideoModel, right: Use
 }
 
 async function isVideoExist (id: string, res: Response, fetchType: VideoFetchType = 'all') {
-  const video = await fetchVideo(id, fetchType)
+  const userId = res.locals.oauth ? res.locals.oauth.token.User.id : undefined
+
+  const video = await fetchVideo(id, fetchType, userId)
 
   if (video === null) {
     res.status(404)