Skip to content

Commit

Permalink
styling
Browse files Browse the repository at this point in the history
  • Loading branch information
imerabishvili committed Nov 13, 2023
1 parent faef316 commit a1df94e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/main/java/org/folio/rest/impl/PiecesAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ public void postOrdersStoragePieces(Piece entity, Map<String, String> okapiHeade
if (ar.succeeded()) {
log.info("Create piece complete, id={}", entity.getId());
auditOutboxService.processOutboxEventLogs(okapiHeaders);
String endpoint = HelperUtils.getEndpoint(OrdersStoragePieces.class) + entity.getId();
asyncResultHandler.handle(buildResponseWithLocation(entity, endpoint));
asyncResultHandler.handle(buildResponseWithLocation(entity, getEndpoint(entity)));
} else {
log.error("Piece creation failed, piece={}", JsonObject.mapFrom(entity).encodePrettily(), ar.cause());
asyncResultHandler.handle(buildErrorResponse(ar.cause()));
Expand Down Expand Up @@ -135,7 +134,7 @@ private Future<RowSet<Row>> updatePiece(Conn conn, Piece piece, String id) {

@Override
protected String getEndpoint(Object entity) {
return null;
return HelperUtils.getEndpoint(OrdersStoragePieces.class) + JsonObject.mapFrom(entity).getString("id");
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.folio.services.acquisitions;

import static org.folio.rest.jaxrs.resource.OrdersStorageAcquisitionMethods.PostOrdersStorageAcquisitionMethodsResponse;
import static org.folio.rest.jaxrs.resource.OrdersStorageAcquisitionMethods.PostOrdersStorageAcquisitionMethodsResponse.headersFor201;
import static org.folio.rest.jaxrs.resource.OrdersStorageAcquisitionMethods.PostOrdersStorageAcquisitionMethodsResponse.respond201WithApplicationJson;

import java.util.UUID;

Expand Down Expand Up @@ -37,8 +38,7 @@ public void createAcquisitionsMethod(AcquisitionMethod acquisitionMethod, Contex
.onSuccess(entity -> {
log.info("AcquisitionMethod with id {} created", acquisitionMethod.getId());
asyncResultHandler.handle(Future.succeededFuture(
PostOrdersStorageAcquisitionMethodsResponse.respond201WithApplicationJson(
entity, PostOrdersStorageAcquisitionMethodsResponse.headersFor201())));
respond201WithApplicationJson(entity, headersFor201())));
})
.onFailure(throwable -> {
log.error("AcquisitionMethod creation with id {} failed", acquisitionMethod.getId(), throwable);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.folio.services.acquisitions;

import static org.folio.rest.jaxrs.resource.AcquisitionsUnitsStorage.PostAcquisitionsUnitsStorageUnitsResponse;
import static org.folio.rest.jaxrs.resource.AcquisitionsUnitsStorage.PostAcquisitionsUnitsStorageUnitsResponse.headersFor201;
import static org.folio.rest.jaxrs.resource.AcquisitionsUnitsStorage.PostAcquisitionsUnitsStorageUnitsResponse.respond201WithApplicationJson;

import java.util.UUID;

Expand Down Expand Up @@ -37,8 +38,7 @@ public void createAcquisitionsUnit(AcquisitionsUnit acquisitionsUnit, Context ve
.onSuccess(entity -> {
log.info("AcquisitionService with id {} created", acquisitionsUnit.getId());
asyncResultHandler.handle(Future.succeededFuture(
PostAcquisitionsUnitsStorageUnitsResponse.respond201WithApplicationJson(
entity, PostAcquisitionsUnitsStorageUnitsResponse.headersFor201())));
respond201WithApplicationJson(entity, headersFor201())));
})
.onFailure(throwable -> {
log.error("AcquisitionService creation with id {} failed", acquisitionsUnit.getId(), throwable);
Expand Down

0 comments on commit a1df94e

Please sign in to comment.