dont show tags from cid -1

This commit is contained in:
Barış Soner Uşaklı
2024-05-03 11:27:52 -04:00
parent 3636dec76b
commit f24a1a34ce

View File

@@ -68,6 +68,7 @@ module.exports = function (SocketTopics) {
}
}
data.cids = await categories.getCidsByPrivilege('categories:cid', uid, 'topics:read');
data.cids = data.cids.filter(cid => cid !== -1);
return await method(data);
}
@@ -106,7 +107,8 @@ module.exports = function (SocketTopics) {
const start = parseInt(data.after, 10);
const stop = start + 99;
const cids = await categories.getCidsByPrivilege('categories:cid', socket.uid, 'topics:read');
let cids = await categories.getCidsByPrivilege('categories:cid', socket.uid, 'topics:read');
cids = cids.filter(cid => cid !== -1);
const tags = await topics.getCategoryTagsData(cids, start, stop);
return { tags: tags.filter(Boolean), nextStart: stop + 1 };
};