Do not wait the make friends process ends to send a response to the
request
This commit is contained in:
parent
6be622478a
commit
9ab1071c8d
|
@ -61,7 +61,8 @@ export class FriendAddComponent {
|
|||
if (status === 409) {
|
||||
alert('Already made friends!');
|
||||
} else {
|
||||
alert('Made friends!');
|
||||
alert('Make friends request sent!');
|
||||
this.router.navigate([ '/admin/friends/list' ]);
|
||||
}
|
||||
},
|
||||
error => alert(error)
|
||||
|
|
|
@ -86,10 +86,15 @@ function makeFriends (req, res, next) {
|
|||
const urls = req.body.urls
|
||||
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue