diff --git a/src/main/java/org/folio/services/fiscalyear/FiscalYearApiService.java b/src/main/java/org/folio/services/fiscalyear/FiscalYearApiService.java index 2d95f32e..91eeae85 100644 --- a/src/main/java/org/folio/services/fiscalyear/FiscalYearApiService.java +++ b/src/main/java/org/folio/services/fiscalyear/FiscalYearApiService.java @@ -49,10 +49,12 @@ public Future createFiscalYear(FiscalYear fiscalYear, RequestContext }); } - public Future getFiscalYearsWithAcqUnitsRestriction(String query, int offset, int limit, RequestContext requestContext) { + public Future getFiscalYearsWithAcqUnitsRestriction(String query, int offset, int limit, + RequestContext requestContext) { return acqUnitsService.buildAcqUnitsCqlClause(requestContext) .map(clause -> StringUtils.isEmpty(query) ? clause : combineCqlExpressions("and", clause, query)) - .compose(effectiveQuery -> fiscalYearService.getFiscalYearByQuery(effectiveQuery, offset, limit, requestContext)); + .compose(effectiveQuery -> fiscalYearService.getFiscalYearsWithoutAcqUnitsRestriction(effectiveQuery, offset, + limit, requestContext)); } public Future getFiscalYearById(String id, boolean withFinancialSummary, RequestContext requestContext) { diff --git a/src/main/java/org/folio/services/fiscalyear/FiscalYearService.java b/src/main/java/org/folio/services/fiscalyear/FiscalYearService.java index c3265657..f7ebc593 100644 --- a/src/main/java/org/folio/services/fiscalyear/FiscalYearService.java +++ b/src/main/java/org/folio/services/fiscalyear/FiscalYearService.java @@ -39,14 +39,6 @@ public Future getFiscalYearsWithoutAcqUnitsRestriction(St return restClient.get(requestEntry.buildEndpoint(), FiscalYearsCollection.class, requestContext); } - public Future getFiscalYearByQuery(String query, int offset, int limit, RequestContext requestContext) { - var requestEntry = new RequestEntry(resourcesPath(FISCAL_YEARS_STORAGE)) - .withOffset(offset) - .withLimit(limit) - .withQuery(query); - return restClient.get(requestEntry.buildEndpoint(), FiscalYearsCollection.class, requestContext); - } - public Future getFiscalYearById(String id, RequestContext requestContext) { return restClient.get(resourceByIdPath(FISCAL_YEARS_STORAGE, id), FiscalYear.class, requestContext); }