forked from alemi/upub
feat: don't add next link when done paginating
This commit is contained in:
parent
e9c765b555
commit
165bf19f8c
1 changed files with 7 additions and 1 deletions
|
@ -236,8 +236,14 @@ impl Context {
|
|||
.set_id(Some(&format!("{id}?offset={offset}")))
|
||||
.set_collection_type(Some(apb::CollectionType::OrderedCollectionPage))
|
||||
.set_part_of(apb::Node::link(id.replace("/page", "")))
|
||||
.set_next(apb::Node::link(format!("{id}?offset={}", offset+limit)))
|
||||
.set_ordered_items(apb::Node::array(items))
|
||||
.set_next(
|
||||
if items.len() < limit as usize {
|
||||
apb::Node::Empty
|
||||
} else {
|
||||
apb::Node::link(format!("{id}?offset={}", offset+limit))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
pub async fn dispatch(&self, uid: &str, activity_targets: Vec<String>, aid: &str, oid: Option<&str>) -> crate::Result<()> {
|
||||
|
|
Loading…
Reference in a new issue