mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: always send replies uri instead of null if no replies exist, @trwnh
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user