Better checks on HasNextPage

This commit is contained in:
gfleury 2020-03-19 19:05:36 -03:00
parent defacfd94c
commit c269de5f9f

View File

@ -555,6 +555,7 @@ func NewRawAPIResponse(r *http.Response) (*APIResponse, error) {
// HasNextPage returns if response is paged and has next page and where it does start // HasNextPage returns if response is paged and has next page and where it does start
func HasNextPage(response *APIResponse) (isLastPage bool, nextPageStart int) { func HasNextPage(response *APIResponse) (isLastPage bool, nextPageStart int) {
isLastPage = true
isLastPage, ok := response.Values["isLastPage"].(bool) isLastPage, ok := response.Values["isLastPage"].(bool)
if ok && !isLastPage { if ok && !isLastPage {
floatStart, ok := response.Values["nextPageStart"].(float64) floatStart, ok := response.Values["nextPageStart"].(float64)