Skip to content

Commit

Permalink
review update
Browse files Browse the repository at this point in the history
  • Loading branch information
imerabishvili committed Jan 15, 2024
1 parent 9116fd7 commit 77a4c70
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ private Future<String> handleItem(PieceUpdateHolder holder, RequestContext reque
}
return inventoryManager.getItemRecordById(pieceToUpdate.getItemId(), true, requestContext)
.compose(jsonItem -> {
boolean noJsonItem = jsonItem == null || jsonItem.isEmpty();
if (holder.isCreateItem() && noJsonItem && pieceToUpdate.getHoldingId() != null) {
boolean jsonItemFound = jsonItem != null && !jsonItem.isEmpty();
if (holder.isCreateItem() && !jsonItemFound && pieceToUpdate.getHoldingId() != null) {
return pieceUpdateInventoryService.manualPieceFlowCreateItemRecord(pieceToUpdate, poLineToSave, requestContext);
}
if (!noJsonItem) {
if (jsonItemFound) {
return updateItemWithFields(jsonItem, poLineToSave, pieceToUpdate)
.compose(ignored -> inventoryManager.updateItem(jsonItem, requestContext).map(item -> jsonItem.getString(ID)));
}
Expand Down

0 comments on commit 77a4c70

Please sign in to comment.