Skip to content

Commit 366a6e2

Browse files
committed
- improves response time of api call
1 parent 5c00243 commit 366a6e2

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

grails-app/controllers/au/org/ala/profile/api/ApiController.groovy

+5-10
Original file line numberDiff line numberDiff line change
@@ -271,16 +271,11 @@ class ApiController extends BaseController {
271271
String taxonRank = params.taxonRank ?: ""
272272
String rankFilter = params.rankFilter ?: ""
273273

274-
def opus = profileService.getOpus(params.opusId)
275-
if (!opus) {
276-
notFound()
277-
} else {
278-
def result = apiService.getProfiles(params.opusId, startIndex, pageSize, sort, order, taxonName, taxonRank, rankFilter)
279-
def profiles = result?.resp.profiles
280-
def count = result?.resp.count
281-
response.addIntHeader('X-Total-Count', count)
282-
render profiles as JSON
283-
}
274+
def result = apiService.getProfiles(params.opusId, startIndex, pageSize, sort, order, taxonName, taxonRank, rankFilter)
275+
def profiles = result?.resp.profiles
276+
def count = result?.resp.count
277+
response.addIntHeader('X-Total-Count', count)
278+
render profiles as JSON
284279
}
285280
}
286281

0 commit comments

Comments
 (0)