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); }