From 366a6e29373d570c3f558838ba69624f43f1e42c Mon Sep 17 00:00:00 2001 From: temi Date: Mon, 29 Jul 2024 11:09:27 +1000 Subject: [PATCH] #817 - improves response time of api call --- .../au/org/ala/profile/api/ApiController.groovy | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/grails-app/controllers/au/org/ala/profile/api/ApiController.groovy b/grails-app/controllers/au/org/ala/profile/api/ApiController.groovy index 7ec5bb71..73d25ebe 100644 --- a/grails-app/controllers/au/org/ala/profile/api/ApiController.groovy +++ b/grails-app/controllers/au/org/ala/profile/api/ApiController.groovy @@ -271,16 +271,11 @@ class ApiController extends BaseController { String taxonRank = params.taxonRank ?: "" String rankFilter = params.rankFilter ?: "" - def opus = profileService.getOpus(params.opusId) - if (!opus) { - notFound() - } else { - def result = apiService.getProfiles(params.opusId, startIndex, pageSize, sort, order, taxonName, taxonRank, rankFilter) - def profiles = result?.resp.profiles - def count = result?.resp.count - response.addIntHeader('X-Total-Count', count) - render profiles as JSON - } + def result = apiService.getProfiles(params.opusId, startIndex, pageSize, sort, order, taxonName, taxonRank, rankFilter) + def profiles = result?.resp.profiles + def count = result?.resp.count + response.addIntHeader('X-Total-Count', count) + render profiles as JSON } }