]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/user-subscriptions.ts
Prevent logging an error on lazy static 404
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / user-subscriptions.ts
index 48ce90d7b0f7f30a82f76034e214b958ebf644a3..73da3142a96bf87d52c4d83a1d7469b59dd284f4 100644 (file)
@@ -58,7 +58,12 @@ const userSubscriptionGetValidator = [
     if (host === WEBSERVER.HOST) host = null
 
     const user = res.locals.oauth.token.User
-    const subscription = await ActorFollowModel.loadByActorAndTargetNameAndHostForAPI(user.Account.Actor.id, name, host)
+    const subscription = await ActorFollowModel.loadByActorAndTargetNameAndHostForAPI({
+      actorId: user.Account.Actor.id,
+      targetName: name,
+      targetHost: host,
+      state: 'accepted'
+    })
 
     if (!subscription || !subscription.ActorFollowing.VideoChannel) {
       return res.fail({