Skip to content

Commit 55a64fc

Browse files
authored
Merge pull request #284 from AtlasOfLivingAustralia/feature/biocollect-1586
fix an issue with old species list is not downloading the whole list but only the first 400
2 parents 912a780 + 2dc3aca commit 55a64fc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

grails-app/services/au/org/ala/ecodata/forms/SpeciesListService.groovy

+2-2
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ class SpeciesListService {
223223
return null
224224
}
225225

226-
String url = grailsApplication.config.getProperty('lists.baseURL') + SPECIES_LIST_ITEMS_PATH_V1 + '/' + listId
227-
Map params = [includeKVP: true, pageSize: pageSize, page: page]
226+
String url = grailsApplication.config.getProperty('lists.baseURL') + SPECIES_LIST_ITEMS_PATH_V1 + '/' + URLEncoder.encode(listId, ENCODING)
227+
Map params = [includeKVP: true, offset: (page - 1) * page, max: pageSize]
228228
if (query) {
229229
params.q = query
230230
}

src/test/groovy/au/org/ala/ecodata/forms/SpeciesListServiceSpec.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class SpeciesListServiceSpec extends Specification implements ServiceUnitTest<Sp
180180
def result = service.speciesListItemsUsingV1(listId, params.pageSize, params.page, params.q)
181181

182182
then:
183-
1 * webService.getJson({it.endsWith("/ws/speciesListItems/${listId}")}, params) >> mockResponse
183+
1 * webService.getJson({it.endsWith("/ws/speciesListItems/${listId}")}, [includeKVP: true, max:10, offset: 0, q: "test"]) >> mockResponse
184184

185185
and:
186186
if (expectedResult) {

0 commit comments

Comments
 (0)