Sha256: 5a206297eddb364c5c8f2b082d30898c469e79d364c8b55fee79f9fd274ba209

Contents?: true

Size: 462 Bytes

Versions: 5

Compression:

Stored size: 462 Bytes

Contents

module Workarea
  decorate Storefront::CartItemsController, with: :mail_chimp do
    decorated do
      after_action :sync_with_mailchimp, only: [:create, :update]
    end

    def destroy
      super
      Workarea::MailChimp::Ecommerce::SaveCart.perform_async(current_order.id, deleted_item_id: params[:id])
    end

    private

    def sync_with_mailchimp
      Workarea::MailChimp::Ecommerce::SaveCart.perform_async(current_order.id, { })
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
workarea-mail_chimp-3.1.0 app/controllers/workarea/storefront/cart_items_controller.decorator
workarea-mail_chimp-3.0.5 app/controllers/workarea/storefront/cart_items_controller.decorator
workarea-mail_chimp-3.0.4 app/controllers/workarea/storefront/cart_items_controller.decorator
workarea-mail_chimp-3.0.3 app/controllers/workarea/storefront/cart_items_controller.decorator
workarea-mail_chimp-3.0.2 app/controllers/workarea/storefront/cart_items_controller.decorator