Skip to content

Commit

Permalink
Fixed: Outdated method call in ShoppingListServicesScript.groovy (#726)
Browse files Browse the repository at this point in the history
(OFBIZ-12939)
  • Loading branch information
cshan-ecomify authored Mar 14, 2024
1 parent 4412dc1 commit 1d09747
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ Map updateShoppingList() {

/**
* Create a ShoppingList Item
* @return
*/
Map createShoppingListItem() {
Map result = success()
Expand All @@ -87,16 +86,15 @@ Map createShoppingListItem() {
.where('shoppingListId', parameters.shoppingListId, 'shoppingListItemSeqId', shoppingListItem.shoppingListItemSeqId)
.queryList()
if ((!slItemAttributes && !parameters.shoppingListItemAttributes) ||
UtilValidate.areEqual(slItemAttributes, parameters.shoppingListItemAttributes)) {
BigDecimal totalquantity = shoppingListItem.quantity + parameters.quantity
result.shoppingListItemSeqId = shoppingListItem.shoppingListItemSeqId
Map serviceResult = run service: 'updateShoppingListItem', with: [* : shoppingListItem,
quantity: totalquantity]
if (!ServiceUtil.isSuccess(serviceResult)) {
return error(serviceResult.errorMessage)
}
// Exit here, because we found an existing item update, otherwise we have to create a new one below
return result
Objects.equals(slItemAttributes, parameters.shoppingListItemAttributes)) {
BigDecimal totalquantity = shoppingListItem.quantity + parameters.quantity
result.shoppingListItemSeqId = shoppingListItem.shoppingListItemSeqId
Map serviceResult = run service: 'updateShoppingListItem', with: [*: shoppingListItem, quantity: totalquantity]
if (!ServiceUtil.isSuccess(serviceResult)) {
return error(serviceResult.errorMessage)
}
// Exit here, because we found an existing item update, otherwise we have to create a new one below
return result
}
}
}
Expand Down

0 comments on commit 1d09747

Please sign in to comment.