aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-01 18:47:57 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-01 18:47:57 +0100
commit4b08096b2c58f801e5aad19e38d24ec59dd3e14e (patch)
tree914bc9704c3f32e4366a518369be33b512b56256 /server/lib
parentbf2fc85c834f5be016f119f59844e49fe3751e6a (diff)
downloadPeerTube-4b08096b2c58f801e5aad19e38d24ec59dd3e14e.tar.gz
PeerTube-4b08096b2c58f801e5aad19e38d24ec59dd3e14e.tar.zst
PeerTube-4b08096b2c58f801e5aad19e38d24ec59dd3e14e.zip
Server: add endpoint in requests
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/friends.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/lib/friends.js b/server/lib/friends.js
index 3f100545c..eafffaab0 100644
--- a/server/lib/friends.js
+++ b/server/lib/friends.js
@@ -28,7 +28,7 @@ const friends = {
28} 28}
29 29
30function addVideoToFriends (video) { 30function addVideoToFriends (video) {
31 createRequest('add', video) 31 createRequest('add', constants.REQUEST_ENDPOINTS.VIDEOS, video)
32} 32}
33 33
34function hasFriends (callback) { 34function hasFriends (callback) {
@@ -119,7 +119,7 @@ function quitFriends (callback) {
119} 119}
120 120
121function removeVideoToFriends (videoParams) { 121function removeVideoToFriends (videoParams) {
122 createRequest('remove', videoParams) 122 createRequest('remove', constants.REQUEST_ENDPOINTS.VIDEOS, videoParams)
123} 123}
124 124
125function sendOwnedVideosToPod (podId) { 125function sendOwnedVideosToPod (podId) {
@@ -137,7 +137,7 @@ function sendOwnedVideosToPod (podId) {
137 return 137 return
138 } 138 }
139 139
140 createRequest('add', remoteVideo, [ podId ]) 140 createRequest('add', constants.REQUEST_ENDPOINTS.VIDEOS, remoteVideo, [ podId ])
141 }) 141 })
142 }) 142 })
143 }) 143 })
@@ -250,8 +250,9 @@ function makeRequestsToWinningPods (cert, podsList, callback) {
250 }) 250 })
251} 251}
252 252
253function createRequest (type, data, to) { 253function createRequest (type, endpoint, data, to) {
254 const req = new Request({ 254 const req = new Request({
255 endpoint,
255 request: { 256 request: {
256 type: type, 257 type: type,
257 data: data 258 data: data