eric-at-nocoast/zendesk-node-api

the search call is only returning the results but the whole set is needed for paging

Opened this issue · 0 comments

Im finding myself expecting the whole result set to do paging. I do see the merit in returning just the tickets, but it falls short.

Here's the offending bit of code:
screen_shot_2017-01-18_at_8_26_39_pm

This is what is returned alongside the results:
{
"results": [
...
],
"followup_ids": [],
"ticket_form_id": ,
"brand_id": 1
*,
"satisfaction_probability": null,
"allow_channelback": false,
"result_type": "ticket"
}
],
"facets": null,
"next_page": "https://*****.zendesk.com/api/v2/search.json?page=2&per_page=5&query=type%3Aticket+created%3C2016-09-02T00%3A00%3A00Z+created%3E2016-09-01T00%3A00%3A00Z&sort_by=created_at&sort_order=asc",
"previous_page": null,
"count": 395
}

With the code as it is, how would you approach it?