mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
fix: spec
This commit is contained in:
@@ -355,6 +355,37 @@ UserObjectFull:
|
|||||||
type: string
|
type: string
|
||||||
moderationNote:
|
moderationNote:
|
||||||
type: string
|
type: string
|
||||||
|
counts:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
best:
|
||||||
|
type: number
|
||||||
|
blocks:
|
||||||
|
type: number
|
||||||
|
bookmarks:
|
||||||
|
type: number
|
||||||
|
categoriesWatched:
|
||||||
|
type: number
|
||||||
|
downvoted:
|
||||||
|
type: number
|
||||||
|
followers:
|
||||||
|
type: number
|
||||||
|
following:
|
||||||
|
type: number
|
||||||
|
groups:
|
||||||
|
type: number
|
||||||
|
ignored:
|
||||||
|
type: number
|
||||||
|
posts:
|
||||||
|
type: number
|
||||||
|
topics:
|
||||||
|
type: number
|
||||||
|
uploaded:
|
||||||
|
type: number
|
||||||
|
upvoted:
|
||||||
|
type: number
|
||||||
|
watched:
|
||||||
|
type: number
|
||||||
isBlocked:
|
isBlocked:
|
||||||
type: boolean
|
type: boolean
|
||||||
blocksCount:
|
blocksCount:
|
||||||
|
|||||||
@@ -29,6 +29,37 @@ get:
|
|||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
|
counts:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
best:
|
||||||
|
type: number
|
||||||
|
blocks:
|
||||||
|
type: number
|
||||||
|
bookmarks:
|
||||||
|
type: number
|
||||||
|
categoriesWatched:
|
||||||
|
type: number
|
||||||
|
downvoted:
|
||||||
|
type: number
|
||||||
|
followers:
|
||||||
|
type: number
|
||||||
|
following:
|
||||||
|
type: number
|
||||||
|
groups:
|
||||||
|
type: number
|
||||||
|
ignored:
|
||||||
|
type: number
|
||||||
|
posts:
|
||||||
|
type: number
|
||||||
|
topics:
|
||||||
|
type: number
|
||||||
|
uploaded:
|
||||||
|
type: number
|
||||||
|
upvoted:
|
||||||
|
type: number
|
||||||
|
watched:
|
||||||
|
type: number
|
||||||
isBlocked:
|
isBlocked:
|
||||||
type: boolean
|
type: boolean
|
||||||
blocksCount:
|
blocksCount:
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ blocksController.getBlocks = async function (req, res, next) {
|
|||||||
userData.users = await user.getUsers(data.uids, req.uid);
|
userData.users = await user.getUsers(data.uids, req.uid);
|
||||||
userData.title = '[[pages:account/blocks, ' + userData.username + ']]';
|
userData.title = '[[pages:account/blocks, ' + userData.username + ']]';
|
||||||
|
|
||||||
const pageCount = Math.ceil(userData.blocksCount / resultsPerPage);
|
const pageCount = Math.ceil(userData.counts.blocks / resultsPerPage);
|
||||||
userData.pagination = pagination.create(page, pageCount);
|
userData.pagination = pagination.create(page, pageCount);
|
||||||
|
|
||||||
userData.breadcrumbs = helpers.buildBreadcrumbs([{ text: userData.username, url: '/user/' + userData.userslug }, { text: '[[user:blocks]]' }]);
|
userData.breadcrumbs = helpers.buildBreadcrumbs([{ text: userData.username, url: '/user/' + userData.userslug }, { text: '[[user:blocks]]' }]);
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ async function getCounts(userData, callerUID) {
|
|||||||
counts.groups = userData.groups.length;
|
counts.groups = userData.groups.length;
|
||||||
counts.following = userData.followingCount;
|
counts.following = userData.followingCount;
|
||||||
counts.followers = userData.followerCount;
|
counts.followers = userData.followerCount;
|
||||||
|
userData.blocksCount = counts.blocks || 0; // for backwards compatibility, remove in 1.16.0
|
||||||
userData.counts = counts;
|
userData.counts = counts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user