Skip to content

Commit 300f36a

Browse files
committed
- fix an issue with old species list is not downloading the whole list but only the first 400
1 parent 72513bc commit 300f36a

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
@@ -222,8 +222,8 @@ class SpeciesListService {
222222
return null
223223
}
224224

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

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)