aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-08-23 14:48:59 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-08-23 14:48:59 +0200
commit9ab1071c8d90d112f1031cf006ed621011553e84 (patch)
tree5fa2c9442b4366686adcb5b3a135ca75e8af0cb5
parent6be622478a36a20ec36605c772b20009d9d270ac (diff)
downloadPeerTube-9ab1071c8d90d112f1031cf006ed621011553e84.tar.gz
PeerTube-9ab1071c8d90d112f1031cf006ed621011553e84.tar.zst
PeerTube-9ab1071c8d90d112f1031cf006ed621011553e84.zip
Do not wait the make friends process ends to send a response to the
request
-rw-r--r--client/src/app/admin/friends/friend-add/friend-add.component.ts3
-rw-r--r--server/controllers/api/v1/pods.js9
2 files changed, 9 insertions, 3 deletions
diff --git a/client/src/app/admin/friends/friend-add/friend-add.component.ts b/client/src/app/admin/friends/friend-add/friend-add.component.ts
index 07888a781..ffc499b92 100644
--- a/client/src/app/admin/friends/friend-add/friend-add.component.ts
+++ b/client/src/app/admin/friends/friend-add/friend-add.component.ts
@@ -61,7 +61,8 @@ export class FriendAddComponent {
61 if (status === 409) { 61 if (status === 409) {
62 alert('Already made friends!'); 62 alert('Already made friends!');
63 } else { 63 } else {
64 alert('Made friends!'); 64 alert('Make friends request sent!');
65 this.router.navigate([ '/admin/friends/list' ]);
65 } 66 }
66 }, 67 },
67 error => alert(error) 68 error => alert(error)
diff --git a/server/controllers/api/v1/pods.js b/server/controllers/api/v1/pods.js
index 982a1e364..360575a0d 100644
--- a/server/controllers/api/v1/pods.js
+++ b/server/controllers/api/v1/pods.js
@@ -86,10 +86,15 @@ function makeFriends (req, res, next) {
86 const urls = req.body.urls 86 const urls = req.body.urls
87 87
88 friends.makeFriends(urls, function (err) { 88 friends.makeFriends(urls, function (err) {
89 if (err) return next(err) 89 if (err) {
90 logger.error('Could not make friends.', { error: err })
91 return
92 }
90 93
91 res.type('json').status(204).end() 94 logger.info('Made friends!')
92 }) 95 })
96
97 res.type('json').status(204).end()
93} 98}
94 99
95function removePods (req, res, next) { 100function removePods (req, res, next) {