mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
fix: send topic title in context object
This commit is contained in:
@@ -69,7 +69,7 @@ Actors.topic = async function (req, res, next) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let page = parseInt(req.query.page, 10);
|
let page = parseInt(req.query.page, 10);
|
||||||
const { cid, mainPid, slug, postcount } = await topics.getTopicFields(req.params.tid, ['cid', 'mainPid', 'slug', 'postcount']);
|
const { cid, titleRaw: name, mainPid, slug, postcount } = await topics.getTopicFields(req.params.tid, ['cid', 'title', 'mainPid', 'slug', 'postcount']);
|
||||||
const pageCount = Math.max(1, Math.ceil(postcount / meta.config.postsPerPage));
|
const pageCount = Math.max(1, Math.ceil(postcount / meta.config.postsPerPage));
|
||||||
let items;
|
let items;
|
||||||
let paginate = true;
|
let paginate = true;
|
||||||
@@ -99,6 +99,7 @@ Actors.topic = async function (req, res, next) {
|
|||||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||||
id: `${nconf.get('url')}/topic/${req.params.tid}${paginate && page ? `?page=${page}` : ''}`,
|
id: `${nconf.get('url')}/topic/${req.params.tid}${paginate && page ? `?page=${page}` : ''}`,
|
||||||
url: `${nconf.get('url')}/topic/${slug}`,
|
url: `${nconf.get('url')}/topic/${slug}`,
|
||||||
|
name,
|
||||||
type: paginate && items ? 'OrderedCollectionPage' : 'OrderedCollection',
|
type: paginate && items ? 'OrderedCollectionPage' : 'OrderedCollection',
|
||||||
audience: `${nconf.get('url')}/category/${cid}`,
|
audience: `${nconf.get('url')}/category/${cid}`,
|
||||||
totalItems: postcount,
|
totalItems: postcount,
|
||||||
|
|||||||
Reference in New Issue
Block a user