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').html(html);
$('#users-container').siblings('div.alert')[html.length ? 'hide' : 'show'](); $('#users-container').siblings('div.alert')[html.length ? 'hide' : 'show']();
}); });
$(window).trigger('action:user.blocks.toggle', { data: payload });
}) })
.fail(function () { .fail(function () {
ajaxify.go(ajaxify.currentPage); ajaxify.go(ajaxify.currentPage);

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

Loading…
Cancel
Save