]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/follows.ts
Add ability to search video channels
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / follows.ts
index 040ee1f217370708cdc0771cbdd7469f9f791608..73fa28be95556bf83a7e7efc50716c6eba497e37 100644 (file)
@@ -4,7 +4,7 @@ import { isTestInstance } from '../../helpers/core-utils'
 import { isEachUniqueHostValid, isHostValid } from '../../helpers/custom-validators/servers'
 import { logger } from '../../helpers/logger'
 import { getServerActor } from '../../helpers/utils'
-import { CONFIG } from '../../initializers'
+import { CONFIG, SERVER_ACTOR_NAME } from '../../initializers'
 import { ActorFollowModel } from '../../models/activitypub/actor-follow'
 import { areValidationErrors } from './utils'
 
@@ -38,7 +38,7 @@ const removeFollowingValidator = [
     if (areValidationErrors(req, res)) return
 
     const serverActor = await getServerActor()
-    const follow = await ActorFollowModel.loadByActorAndTargetHost(serverActor.id, req.params.host)
+    const follow = await ActorFollowModel.loadByActorAndTargetNameAndHostForAPI(serverActor.id, SERVER_ACTOR_NAME, req.params.host)
 
     if (!follow) {
       return res