From 3c8ca4fbcea6729d581ceb190d22c04dbb1bbe1e Mon Sep 17 00:00:00 2001 From: SinghAdes <90304030+SinghAdes@users.noreply.github.com> Date: Mon, 1 Jan 2024 12:19:15 +0530 Subject: [PATCH] [CIRC-1988-1]-Added Fix (#1416) --- .../infrastructure/storage/inventory/ItemRepository.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/folio/circulation/infrastructure/storage/inventory/ItemRepository.java b/src/main/java/org/folio/circulation/infrastructure/storage/inventory/ItemRepository.java index de153ba0e2..86c3265421 100644 --- a/src/main/java/org/folio/circulation/infrastructure/storage/inventory/ItemRepository.java +++ b/src/main/java/org/folio/circulation/infrastructure/storage/inventory/ItemRepository.java @@ -147,6 +147,7 @@ public CompletableFuture> fetchByBarcode(String barcode) { return fetchItemByBarcode(barcode, createItemFinder()) .thenComposeAsync(itemResult -> itemResult.after(when(item -> ofAsync(item::isNotFound), item -> fetchItemByBarcode(barcode, createCirculationItemFinder()) + .thenApply(r -> r.mapFailure(failure -> Result.succeeded(item))) , item -> completedFuture(itemResult)))) .thenComposeAsync(this::fetchItemRelatedRecords); }