Skip to content

Commit

Permalink
Pr 1709 dev (#7)
Browse files Browse the repository at this point in the history
* PR-1709 Make valid response with all mandatory fields

* PR-1709 Use user barcode for request item
  • Loading branch information
JanisSaldabols authored May 22, 2024
1 parent fd42add commit 51c956f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/org/folio/ncip/FolioRemoteServiceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,9 @@ public JsonObject acceptItem(AcceptItemInitiationData initData, UserId userId, S

public JsonObject requestItem(String hrid, UserId userId, boolean titleRequest, String requestType) throws Exception {
JsonObject returnValues = new JsonObject();
JsonObject user = lookupPatronRecord(userId);
if (user == null)
throw new FolioNcipException(Constants.USER_NOT_FOUND);
try {
String baseUrl = okapiHeaders.get(Constants.X_OKAPI_URL);
String searchUrl = baseUrl + (titleRequest ? Constants.INSTANCE_SEARCH_URL : Constants.ITEM_SEARCH_URL)
Expand All @@ -580,7 +583,7 @@ public JsonObject requestItem(String hrid, UserId userId, boolean titleRequest,
}
request.put("requestType", requestType);
request.put("fulfillmentPreference", "Delivery");
request.put("requesterId", userId.getUserIdentifierValue());
request.put("requesterId", user.getString("id"));
request.put("requestDate", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(ZonedDateTime.now()));

String requestUrl = baseUrl + Constants.REQUEST_URL;
Expand Down

0 comments on commit 51c956f

Please sign in to comment.