fix(update$): Remove User.update$, refactor to use native loopback interfaces
This commit is contained in:
committed by
mrugesh mohapatra
parent
97f7d53bee
commit
0f73fdbd9c
@ -120,12 +120,15 @@ function getUnlinkSocial(req, res, next) {
|
||||
|
||||
const updateData = { [social]: null };
|
||||
|
||||
return user.update$(updateData).subscribe(() => {
|
||||
return user.updateAttributes(updateData, err => {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
log(`${social} has been unlinked successfully`);
|
||||
|
||||
req.flash('info', `You've successfully unlinked your ${social}.`);
|
||||
return res.redirect('/' + username);
|
||||
}, next);
|
||||
return res.redirectWithFlash(`${homeLocation}/${username}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user