fix: suggested topic tid

This commit is contained in:
Barış Soner Uşaklı
2024-06-17 18:07:21 -04:00
parent 41f1cd69ad
commit 351ee71d64

View File

@@ -11,7 +11,10 @@ const plugins = require('../plugins');
module.exports = function (Topics) {
Topics.getSuggestedTopics = async function (tid, uid, start, stop, cutoff = 0) {
let tids;
tid = parseInt(tid, 10);
if (!tid) {
return [];
}
tid = String(tid);
cutoff = cutoff === 0 ? cutoff : (cutoff * 2592000000);
const { cid, title, tags } = await Topics.getTopicFields(tid, [
'cid', 'title', 'tags',