fix: wrong property name for OrderedCollection items

This commit is contained in:
Julian Lam
2024-06-28 15:12:47 -04:00
parent e75ec39b70
commit a2fb939b5c
2 changed files with 6 additions and 2 deletions

View File

@@ -30,11 +30,15 @@ Contexts.get = async (uid, id) => {
Contexts.getItems = async (uid, id, root = true) => { Contexts.getItems = async (uid, id, root = true) => {
winston.verbose(`[activitypub/context] Retrieving context ${id}`); winston.verbose(`[activitypub/context] Retrieving context ${id}`);
let { type, items, first, next } = await activitypub.get('uid', uid, id); let { type, items, orderedItems, first, next } = await activitypub.get('uid', uid, id);
if (!acceptableTypes.includes(type)) { if (!acceptableTypes.includes(type)) {
return []; return [];
} }
if (type.startsWith('Ordered')) {
items = orderedItems;
}
if (items) { if (items) {
items = (await Promise.all(items.map(async (item) => { items = (await Promise.all(items.map(async (item) => {
const { type, id } = await activitypub.helpers.resolveLocalId(item); const { type, id } = await activitypub.helpers.resolveLocalId(item);

View File

@@ -107,7 +107,7 @@ Actors.topic = async function (req, res, next) {
}; };
if (items) { if (items) {
object.items = items; object.orderedItems = items;
if (paginate) { if (paginate) {
object.partOf = `${nconf.get('url')}/topic/${req.params.tid}`; object.partOf = `${nconf.get('url')}/topic/${req.params.tid}`;