Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- improves response time of api call
  • Loading branch information
temi committed Jul 29, 2024
1 parent 5c00243 commit 366a6e2
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions grails-app/controllers/au/org/ala/profile/api/ApiController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit 366a6e2

Please sign in to comment.