diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-08-20 16:59:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-08-20 17:11:38 +0200 |
commit | 1e2564d3927ce4ca4ca9a09930da6da7ebb4e9a1 (patch) | |
tree | 1a2601d63152da4906335c6116ba5f1e8992af33 /server/controllers | |
parent | e861452fb26553177ad4e32bfb18b4fd8a5b1816 (diff) | |
download | PeerTube-1e2564d3927ce4ca4ca9a09930da6da7ebb4e9a1.tar.gz PeerTube-1e2564d3927ce4ca4ca9a09930da6da7ebb4e9a1.tar.zst PeerTube-1e2564d3927ce4ca4ca9a09930da6da7ebb4e9a1.zip |
Server: make friends urls come from the request instead of the
configuration file
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/v1/pods.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/controllers/api/v1/pods.js b/server/controllers/api/v1/pods.js index f61f2a483..982a1e364 100644 --- a/server/controllers/api/v1/pods.js +++ b/server/controllers/api/v1/pods.js | |||
@@ -19,7 +19,7 @@ const Video = mongoose.model('Video') | |||
19 | 19 | ||
20 | router.get('/', listPodsUrl) | 20 | router.get('/', listPodsUrl) |
21 | router.post('/', validators.podsAdd, addPods) | 21 | router.post('/', validators.podsAdd, addPods) |
22 | router.get('/makefriends', | 22 | router.post('/makefriends', |
23 | oAuth.authenticate, | 23 | oAuth.authenticate, |
24 | admin.ensureIsAdmin, | 24 | admin.ensureIsAdmin, |
25 | validators.makeFriends, | 25 | validators.makeFriends, |
@@ -83,7 +83,9 @@ function listPodsUrl (req, res, next) { | |||
83 | } | 83 | } |
84 | 84 | ||
85 | function makeFriends (req, res, next) { | 85 | function makeFriends (req, res, next) { |
86 | friends.makeFriends(function (err) { | 86 | const urls = req.body.urls |
87 | |||
88 | friends.makeFriends(urls, function (err) { | ||
87 | if (err) return next(err) | 89 | if (err) return next(err) |
88 | 90 | ||
89 | res.type('json').status(204).end() | 91 | res.type('json').status(204).end() |