mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-29 21:17:17 +00:00
Refactor conditional
CartService#populate already returns the value of the #valid? method by default.
This commit is contained in:
@@ -3,11 +3,9 @@ class CartController < BaseController
|
||||
|
||||
def populate
|
||||
order = current_order(true)
|
||||
|
||||
cart_service = CartService.new(order)
|
||||
|
||||
cart_service.populate(params.slice(:variants, :quantity))
|
||||
if cart_service.valid?
|
||||
if cart_service.populate(params.slice(:variants, :quantity))
|
||||
order.cap_quantity_at_stock!
|
||||
order.recreate_all_fees!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user