Skip to main content

page_dispatch

Function page_dispatch 

Source
pub async fn page_dispatch<F>(
    args: &PageArgs,
    client: &ClickUpClient,
    items_key: &str,
    compact_fields: &[&str],
    build_path: F,
) -> Result<Value, String>
where F: Fn(u64) -> String,
Expand description

Run a page-based pagination loop and return either a bare compact array (no pagination args) or a {items, pagination} envelope (any pagination arg). build_path(page) should return a path including any ?page=N query, e.g. /v2/list/123/task?page=2. items_key is the response field holding the array (e.g. "tasks").