Class: SolidusSubscriptions::Api::V1::SubscriptionsController
- Inherits:
-
Spree::Api::BaseController
- Object
- Spree::Api::BaseController
- SolidusSubscriptions::Api::V1::SubscriptionsController
- Defined in:
- app/controllers/solidus_subscriptions/api/v1/subscriptions_controller.rb
Instance Method Summary collapse
Instance Method Details
#cancel ⇒ Object
20 21 22 23 24 25 26 |
# File 'app/controllers/solidus_subscriptions/api/v1/subscriptions_controller.rb', line 20 def cancel if @subscription.cancel render json: @subscription.to_json else render json: @subscription.errors.to_json, status: 422 end end |
#skip ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/controllers/solidus_subscriptions/api/v1/subscriptions_controller.rb', line 12 def skip if @subscription.skip render json: @subscription.to_json else render json: @subscription.errors.to_json, status: 422 end end |
#update ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/controllers/solidus_subscriptions/api/v1/subscriptions_controller.rb', line 4 def update if @subscription.update(subscription_params) render json: @subscription.to_json(include: [:line_items, :shipping_address]) else render json: @subscription.errors.to_json, status: 422 end end |