Skip to main content

start_id_dispatch

Function start_id_dispatch 

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

Run a start-id-based pagination loop. build_path(start, start_id) should return a path including the ?start=...&start_id=... query when both are Some, or no pagination query when both are None. (ClickUp requires the params as a pair — passing only one is a caller bug.) items_key is the response array’s field name ("comments" for both comment endpoints).

The next-page boundary is derived from the LAST item in the returned array: its date field (a stringified unix-ms timestamp) becomes the next start, and its id field becomes the next start_id. Termination happens when the array is empty OR shorter than START_ID_PAGE_HINT.