From 3a87757ca8ce09b6f34fc4c63a2731d78c8e2af0 Mon Sep 17 00:00:00 2001 From: alexanderkurash Date: Thu, 20 Jun 2024 19:38:28 +0300 Subject: [PATCH] CIRC-2111 Remove redundant UUID parsing --- .../circulation/resources/CirculationSettingsResource.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/org/folio/circulation/resources/CirculationSettingsResource.java b/src/main/java/org/folio/circulation/resources/CirculationSettingsResource.java index 84cfe8ead1..a0c80980ef 100644 --- a/src/main/java/org/folio/circulation/resources/CirculationSettingsResource.java +++ b/src/main/java/org/folio/circulation/resources/CirculationSettingsResource.java @@ -77,7 +77,6 @@ void get(RoutingContext routingContext) { ofAsync(routingContext.request().getParam("id")) .thenApply(refuseWhenIdIsInvalid()) - .thenApply(r -> r.map(providedId -> UUID.fromString(providedId).toString())) .thenCompose(r -> r.after(circulationSettingsRepository::getById)) .thenApply(r -> r.map(CirculationSetting::getRepresentation)) .thenApply(r -> r.map(JsonHttpResponse::ok)) @@ -91,7 +90,6 @@ void delete(RoutingContext routingContext) { ofAsync(routingContext.request().getParam("id")) .thenApply(refuseWhenIdIsInvalid()) - .thenApply(r -> r.map(providedId -> UUID.fromString(providedId).toString())) .thenCompose(r -> r.after(clients.circulationSettingsStorageClient()::delete)) .thenApply(r -> r.map(toFixedValue(NoContentResponse::noContent))) .thenAccept(context::writeResultToHttpResponse); @@ -146,7 +144,7 @@ private boolean uuidIsValid(String providedId) { try { return providedId != null && providedId.equals(UUID.fromString(providedId).toString()); } catch(IllegalArgumentException e) { - log.debug("refuseWhenIdIsInvalid:: Invalid UUID"); + log.debug("uuidIsValid:: Invalid UUID"); return false; } }