Do not wait the make friends process ends to send a response to the

request
pull/10/head
Chocobozzz 2016-08-23 14:48:59 +02:00
parent 6be622478a
commit 9ab1071c8d
2 changed files with 9 additions and 3 deletions

View File

@ -61,7 +61,8 @@ export class FriendAddComponent {
if (status === 409) { if (status === 409) {
alert('Already made friends!'); alert('Already made friends!');
} else { } else {
alert('Made friends!'); alert('Make friends request sent!');
this.router.navigate([ '/admin/friends/list' ]);
} }
}, },
error => alert(error) error => alert(error)

View File

@ -86,10 +86,15 @@ function makeFriends (req, res, next) {
const urls = req.body.urls const urls = req.body.urls
friends.makeFriends(urls, function (err) { friends.makeFriends(urls, function (err) {
if (err) return next(err) if (err) {
logger.error('Could not make friends.', { error: err })
return
}
res.type('json').status(204).end() logger.info('Made friends!')
}) })
res.type('json').status(204).end()
} }
function removePods (req, res, next) { function removePods (req, res, next) {