mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 21:30:30 +01:00
fix: sorting when filtering by uid
This commit is contained in:
@@ -101,10 +101,6 @@ module.exports = function (Categories) {
|
||||
set = `cid:${cid}:tids:votes`;
|
||||
}
|
||||
|
||||
if (data.targetUid) {
|
||||
set = `cid:${cid}:uid:${data.targetUid}:tids`;
|
||||
}
|
||||
|
||||
if (data.tag) {
|
||||
if (Array.isArray(data.tag)) {
|
||||
set = [set].concat(data.tag.map(tag => `tag:${tag}:topics`));
|
||||
@@ -112,6 +108,11 @@ module.exports = function (Categories) {
|
||||
set = [set, `tag:${data.tag}:topics`];
|
||||
}
|
||||
}
|
||||
|
||||
if (data.targetUid) {
|
||||
set = (Array.isArray(set) ? set : [set]).concat([`cid:${cid}:uid:${data.targetUid}:tids`]);
|
||||
}
|
||||
|
||||
const result = await plugins.hooks.fire('filter:categories.buildTopicsSortedSet', {
|
||||
set: set,
|
||||
data: data,
|
||||
|
||||
Reference in New Issue
Block a user