1
0
Fork 0
mirror of synced 2024-07-07 23:35:49 +12:00

Fix bug with determing whether another page exists when performing paginated searches

This commit is contained in:
Andrew Kingston 2021-05-13 12:38:12 +01:00
parent 4d564365cf
commit 960a2925ca

View file

@ -244,11 +244,15 @@ exports.paginatedSearch = async (
.setSort(sort)
.setSortOrder(sortOrder)
.setSortType(sortType)
const searchUrl = builder
.setBookmark(bookmark)
.setLimit(limit)
const searchUrl = builder.buildSearchURL()
const nextUrl = builder.setLimit(1).buildSearchURL()
.buildSearchURL()
const searchResults = await runQuery(searchUrl)
const nextUrl = builder
.setBookmark(searchResults.bookmark)
.setLimit(1)
.buildSearchURL()
const nextResults = await runQuery(nextUrl)
return {
...searchResults,