fix: always send replies uri instead of null if no replies exist, @trwnh

This commit is contained in:
Julian Lam
2024-08-01 14:59:28 -04:00
parent 9bd6896d13
commit ff08fbb73f
2 changed files with 3 additions and 3 deletions

View File

@@ -398,6 +398,8 @@ Helpers.generateCollection = async ({ set, method, page, perPage, url }) => {
object.next = page < pageCount ? `${url}?page=${page + 1}` : null; object.next = page < pageCount ? `${url}?page=${page + 1}` : null;
object.prev = page > 1 ? `${url}?page=${page - 1}` : null; object.prev = page > 1 ? `${url}?page=${page - 1}` : null;
} }
} else {
object.orderedItems = [];
} }
if (paginate) { if (paginate) {

View File

@@ -386,8 +386,6 @@ Mocks.note = async (post) => {
return payload; return payload;
}); });
const replyCount = await db.sortedSetCard(`pid:${post.pid}:replies`);
const object = { const object = {
'@context': 'https://www.w3.org/ns/activitystreams', '@context': 'https://www.w3.org/ns/activitystreams',
id, id,
@@ -407,7 +405,7 @@ Mocks.note = async (post) => {
source, source,
tag, tag,
attachment, attachment,
replies: replyCount > 0 ? `${id}/replies` : null, replies: `${id}/replies`,
}; };
return object; return object;