Skip to content

Commit

Permalink
CIRC-2166 revert unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-barannyk committed Nov 7, 2024
1 parent 862ff46 commit 3cd5e9d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 deletions src/main/java/org/folio/circulation/resources/SlipsResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,21 @@ private void getMany(RoutingContext routingContext) {
return;
}

fetchLocationsForServicePoint(servicePointId, clients)
.thenComposeAsync(r -> r.after(ctx -> fetchItemsForLocations(ctx,
itemRepository, LocationRepository.using(clients, servicePointRepository))))
.thenComposeAsync(r -> r.after(ctx -> fetchRequests(ctx, clients)))
.thenComposeAsync(r -> r.after(ctx -> userRepository.findUsersForRequests(
ctx.getRequests())))
.thenComposeAsync(result -> result.after(patronGroupRepository::findPatronGroupsForRequestsUsers))
.thenComposeAsync(r -> r.after(departmentRepository::findDepartmentsForRequestUsers))
.thenComposeAsync(r -> r.after(addressTypeRepository::findAddressTypesForRequests))
.thenComposeAsync(r -> r.after(servicePointRepository::findServicePointsForRequests))
.thenApply(flatMapResult(this::mapResultToJson))
.thenComposeAsync(r -> r.combineAfter(() -> servicePointRepository.getServicePointById(servicePointId),
this::addPrimaryServicePointNameToStaffSlipContext))
.thenApply(r -> r.map(JsonHttpResponse::ok))
.thenAccept(context::writeResultToHttpResponse);
fetchLocationsForServicePoint(servicePointId, clients)
.thenComposeAsync(r -> r.after(ctx -> fetchItemsForLocations(ctx,
itemRepository, LocationRepository.using(clients, servicePointRepository))))
.thenComposeAsync(r -> r.after(ctx -> fetchRequests(ctx, clients)))
.thenComposeAsync(r -> r.after(ctx -> userRepository.findUsersForRequests(
ctx.getRequests())))
.thenComposeAsync(result -> result.after(patronGroupRepository::findPatronGroupsForRequestsUsers))
.thenComposeAsync(r -> r.after(departmentRepository::findDepartmentsForRequestUsers))
.thenComposeAsync(r -> r.after(addressTypeRepository::findAddressTypesForRequests))
.thenComposeAsync(r -> r.after(servicePointRepository::findServicePointsForRequests))
.thenApply(flatMapResult(this::mapResultToJson))
.thenComposeAsync(r -> r.combineAfter(() -> servicePointRepository.getServicePointById(servicePointId),
this::addPrimaryServicePointNameToStaffSlipContext))
.thenApply(r -> r.map(JsonHttpResponse::ok))
.thenAccept(context::writeResultToHttpResponse);
}

private CompletableFuture<Result<StaffSlipsContext>> fetchTitleLevelRequests(
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/api/support/APITestContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private static void outputCQLQueryRequestsPerformedAgainstFakes() {

static URL okapiUrl() {
try {
if (false) {
if (useOkapiForStorage) {
return new URL("http://localhost:9130");
} else {
return new URL(FakeOkapi.getAddress());
Expand Down

0 comments on commit 3cd5e9d

Please sign in to comment.