Skip to content

Commit 57c7f35

Browse files
committed
Merge pull request #110 from joe-gaudet-hs/iterator-fix
Iterator fix
2 parents 10b026d + 3bad424 commit 57c7f35

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Intercom/Model/Iterators/AbstractPageIterator.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected function sendRequest()
2929
$result = $this->command->execute();
3030

3131
// Parse the next token
32-
$this->nextToken = (isset($result['next_page'])) ? $result['next_page'] : false;
32+
$this->nextToken = (isset($result['pages']['next'])) ? $result['pages']['page'] + 1 : false;
3333

3434
// Set the total results
3535
$this->totalResults = $result['total_count'];
@@ -101,4 +101,5 @@ protected function getObjectKeyFromListType($type)
101101
throw new IntercomException("Unknown list type returned ({$type}). Unable to use iterator to paginate");
102102
}
103103
}
104-
}
104+
}
105+

0 commit comments

Comments
 (0)