mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-29 10:49:51 +01:00
fix: partOf and type
This commit is contained in:
@@ -99,16 +99,16 @@ 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}`,
|
||||||
type: items ? 'OrderedCollectionPage' : 'OrderedCollection',
|
type: paginate && items ? 'OrderedCollectionPage' : 'OrderedCollection',
|
||||||
audience: `${nconf.get('url')}/category/${cid}`,
|
audience: `${nconf.get('url')}/category/${cid}`,
|
||||||
totalItems: postcount,
|
totalItems: postcount,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (items) {
|
if (items) {
|
||||||
object.partOf = `${nconf.get('url')}/topic/${req.params.tid}`;
|
|
||||||
object.items = items;
|
object.items = items;
|
||||||
|
|
||||||
if (paginate) {
|
if (paginate) {
|
||||||
|
object.partOf = `${nconf.get('url')}/topic/${req.params.tid}`;
|
||||||
object.next = page < pageCount ? `${nconf.get('url')}/topic/${req.params.tid}?page=${page + 1}` : null;
|
object.next = page < pageCount ? `${nconf.get('url')}/topic/${req.params.tid}?page=${page + 1}` : null;
|
||||||
object.prev = page > 1 ? `${nconf.get('url')}/topic/${req.params.tid}?page=${page - 1}` : null;
|
object.prev = page > 1 ? `${nconf.get('url')}/topic/${req.params.tid}?page=${page - 1}` : null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user