mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36: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.prev = page > 1 ? `${url}?page=${page - 1}` : null;
|
||||
}
|
||||
} else {
|
||||
object.orderedItems = [];
|
||||
}
|
||||
|
||||
if (paginate) {
|
||||
|
||||
@@ -386,8 +386,6 @@ Mocks.note = async (post) => {
|
||||
return payload;
|
||||
});
|
||||
|
||||
const replyCount = await db.sortedSetCard(`pid:${post.pid}:replies`);
|
||||
|
||||
const object = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
id,
|
||||
@@ -407,7 +405,7 @@ Mocks.note = async (post) => {
|
||||
source,
|
||||
tag,
|
||||
attachment,
|
||||
replies: replyCount > 0 ? `${id}/replies` : null,
|
||||
replies: `${id}/replies`,
|
||||
};
|
||||
|
||||
return object;
|
||||
|
||||
Reference in New Issue
Block a user