Sha256: c77928c8b5b46160fdab96bcede94f2a3207e8a46194f954c3458a5650df7a60

Contents?: true

Size: 504 Bytes

Versions: 2

Compression:

Stored size: 504 Bytes

Contents

module Spree::Api::V1::ShipmentsControllerDecorator
  def ship
    unless @shipment.tracking.present?
      # We should enforce entering tracking details, otherwise shipments cannot
      # be created through Mollie.
      unprocessable_entity('Please fill in your tracking details')
      return
    end
    @shipment.ship! unless @shipment.shipped?
    respond_with(@shipment, default_template: :show)
  end
end

Spree::Api::V1::ShipmentsController.prepend(Spree::Api::V1::ShipmentsControllerDecorator)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_mollie_gateway-4.0.1 app/controllers/spree/api/v1/shipments_controller_decorator.rb
spree_mollie_gateway-4.0.0 app/controllers/spree/api/v1/shipments_controller_decorator.rb