feat: some additional work to properly save and retrieve remote topic data

This commit is contained in:
Julian Lam
2024-01-12 16:39:29 -05:00
parent 273188632d
commit 4bd7a574c3
3 changed files with 29 additions and 16 deletions

View File

@@ -23,11 +23,8 @@ controller.get = async function (req, res, next) {
// topics.getTopicData(tid),
]);
const topicData = {
tid,
postCount: 6,
category: {}, // todo
};
const topicData = await topics.getTopicData(tid);
topicData.category = {}; // todo
let currentPage = parseInt(req.query.page, 10) || 1;
const pageCount = Math.max(1, Math.ceil((topicData && topicData.postcount) / settings.postsPerPage));