feat: fix blocksCount not being returned on user profile

add hook action:user.blocks.toggle
v1.18.x
Barış Soner Uşaklı 5 years ago
parent f992af05b6
commit bd228d5ee7

@ -50,6 +50,7 @@ define('forum/account/blocks', ['forum/account/header'], function (header) {
$('#users-container').html(html);
$('#users-container').siblings('div.alert')[html.length ? 'hide' : 'show']();
});
$(window).trigger('action:user.blocks.toggle', { data: payload });
})
.fail(function () {
ajaxify.go(ajaxify.currentPage);

@ -11,8 +11,9 @@ const utils = require('../utils');
const intFields = [
'uid', 'postcount', 'topiccount', 'reputation', 'profileviews',
'banned', 'banned:expire', 'email:confirmed', 'joindate', 'lastonline', 'lastqueuetime',
'lastposttime', 'followingCount', 'followerCount', 'passwordExpiry',
'banned', 'banned:expire', 'email:confirmed', 'joindate', 'lastonline',
'lastqueuetime', 'lastposttime', 'followingCount', 'followerCount',
'blocksCount', 'passwordExpiry',
];
module.exports = function (User) {
@ -27,8 +28,8 @@ module.exports = function (User) {
'lastonline', 'picture', 'fullname', 'location', 'birthday', 'website',
'aboutme', 'signature', 'uploadedpicture', 'profileviews', 'reputation',
'postcount', 'topiccount', 'lastposttime', 'banned', 'banned:expire',
'status', 'flags', 'followerCount', 'followingCount', 'cover:url',
'cover:position', 'groupTitle',
'status', 'flags', 'followerCount', 'followingCount', 'blocksCount',
'cover:url', 'cover:position', 'groupTitle',
];
User.guestData = {

Loading…
Cancel
Save