mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 05:37:35 +02:00
fix: missing orderedItems on category outbox index retrieval
This commit is contained in:
@@ -226,24 +226,26 @@ Controller.getCategoryOutbox = async (req, res) => {
|
|||||||
perPage: 20,
|
perPage: 20,
|
||||||
url: `${nconf.get('url')}/category/1/outbox`,
|
url: `${nconf.get('url')}/category/1/outbox`,
|
||||||
});
|
});
|
||||||
collection.orderedItems = await Promise.all(collection.orderedItems.map(async (pid) => {
|
if (collection.orderedItems) {
|
||||||
let object;
|
collection.orderedItems = await Promise.all(collection.orderedItems.map(async (pid) => {
|
||||||
if (utils.isNumber(pid)) {
|
let object;
|
||||||
const { activity } = await activitypub.mocks.activities.create(pid, 0);
|
if (utils.isNumber(pid)) {
|
||||||
object = activity;
|
const { activity } = await activitypub.mocks.activities.create(pid, 0);
|
||||||
} else {
|
object = activity;
|
||||||
object = pid;
|
} else {
|
||||||
}
|
object = pid;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: `${nconf.get('url')}/post/${encodeURIComponent(pid)}#activity/announce/cid/${cid}`,
|
id: `${nconf.get('url')}/post/${encodeURIComponent(pid)}#activity/announce/cid/${cid}`,
|
||||||
type: 'Announce',
|
type: 'Announce',
|
||||||
actor: `${nconf.get('url')}/category/${cid}`,
|
actor: `${nconf.get('url')}/category/${cid}`,
|
||||||
to: [activitypub._constants.publicAddress],
|
to: [activitypub._constants.publicAddress],
|
||||||
cc: [`${nconf.get('url')}/category/${cid}/followers`],
|
cc: [`${nconf.get('url')}/category/${cid}/followers`],
|
||||||
object,
|
object,
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
res.status(200).json({
|
res.status(200).json({
|
||||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||||
|
|||||||
Reference in New Issue
Block a user