|
|
|
@ -116,11 +116,14 @@ define('forum/account/header', [
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function toggleFollow(type) {
|
|
|
|
|
api[type === 'follow' ? 'put' : 'delete']('/users/' + ajaxify.data.uid + '/follow', undefined, () => {
|
|
|
|
|
api[type === 'follow' ? 'put' : 'delete']('/users/' + ajaxify.data.uid + '/follow', undefined, function (err) {
|
|
|
|
|
if (err) {
|
|
|
|
|
return app.alertError(err);
|
|
|
|
|
}
|
|
|
|
|
components.get('account/follow').toggleClass('hide', type === 'follow');
|
|
|
|
|
components.get('account/unfollow').toggleClass('hide', type === 'unfollow');
|
|
|
|
|
app.alertSuccess('[[global:alert.' + type + ', ' + ajaxify.data.username + ']]');
|
|
|
|
|
}, 'default');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|