]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/user-subscriptions.ts
Server: Bulk update videos support field
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / user-subscriptions.ts
index fd82ed017ac5b05d0ba9fc651617edda504c7ffa..2356745d7e6438c7236c36fa3130766681b19174 100644 (file)
@@ -5,8 +5,8 @@ import { logger } from '../../helpers/logger'
 import { areValidationErrors } from './utils'
 import { ActorFollowModel } from '../../models/activitypub/actor-follow'
 import { areValidActorHandles, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor'
-import { CONFIG } from '../../initializers'
 import { toArray } from '../../helpers/custom-validators/misc'
+import { WEBSERVER } from '../../initializers/constants'
 
 const userSubscriptionAddValidator = [
   body('uri').custom(isValidActorHandle).withMessage('Should have a valid URI to follow (username@domain)'),
@@ -43,7 +43,7 @@ const userSubscriptionGetValidator = [
     if (areValidationErrors(req, res)) return
 
     let [ name, host ] = req.params.uri.split('@')
-    if (host === CONFIG.WEBSERVER.HOST) host = null
+    if (host === WEBSERVER.HOST) host = null
 
     const user = res.locals.oauth.token.User
     const subscription = await ActorFollowModel.loadByActorAndTargetNameAndHostForAPI(user.Account.Actor.id, name, host)