diff --git a/src/main/java/org/folio/edge/patron/PatronHandler.java b/src/main/java/org/folio/edge/patron/PatronHandler.java index 9abcc69..92e84bc 100644 --- a/src/main/java/org/folio/edge/patron/PatronHandler.java +++ b/src/main/java/org/folio/edge/patron/PatronHandler.java @@ -253,7 +253,7 @@ public void handleGetAllowedServicePointsForInstance(RoutingContext ctx) { handleCommon(ctx, new String[] { PARAM_PATRON_ID, PARAM_INSTANCE_ID }, new String[] {}, - (client, params) -> ((PatronOkapiClient) client).getAllowedServicePoints( + (client, params) -> ((PatronOkapiClient) client).getAllowedServicePointsForInstance( params.get(PARAM_PATRON_ID), params.get(PARAM_INSTANCE_ID), resp -> handleProxyResponse(ctx, resp), @@ -264,7 +264,7 @@ public void handleGetAllowedServicePointsForItem(RoutingContext ctx) { handleCommon(ctx, new String[] { PARAM_PATRON_ID, PARAM_ITEM_ID }, new String[] {}, - (client, params) -> ((PatronOkapiClient) client).getAllowedServicePoints( + (client, params) -> ((PatronOkapiClient) client).getAllowedServicePointsForItem( params.get(PARAM_PATRON_ID), params.get(PARAM_ITEM_ID), resp -> handleProxyResponse(ctx, resp), diff --git a/src/main/java/org/folio/edge/patron/utils/PatronOkapiClient.java b/src/main/java/org/folio/edge/patron/utils/PatronOkapiClient.java index 3472e2a..1ddcaaf 100644 --- a/src/main/java/org/folio/edge/patron/utils/PatronOkapiClient.java +++ b/src/main/java/org/folio/edge/patron/utils/PatronOkapiClient.java @@ -188,13 +188,20 @@ public void cancelHold(String patronId, String holdId, JsonObject holdCancellati ); } - public void getAllowedServicePoints(String patronId, String instanceId, + public void getAllowedServicePointsForInstance(String patronId, String instanceId, Handler> responseHandler, Handler exceptionHandler) { get(String.format("%s/patron/account/%s/instance/%s/allowed-service-points", okapiURL, patronId, instanceId), tenant, null, responseHandler, exceptionHandler); } + public void getAllowedServicePointsForItem(String patronId, String itemId, + Handler> responseHandler, Handler exceptionHandler) { + + get(String.format("%s/patron/account/%s/item/%s/allowed-service-points", okapiURL, + patronId, itemId), tenant, null, responseHandler, exceptionHandler); + } + public void getRequest(String holdId, Handler> responseHandler, Handler exceptionHandler) {