summaryrefslogtreecommitdiff
path: root/app/controllers/solidus_subscriptions/api/v1/line_items_controller.rb
diff options
context:
space:
mode:
authorBrendan Deere <brendan@stembolt.com>2016-09-27 16:00:45 -0700
committerBrendan Deere <brendan@stembolt.com>2016-09-27 16:42:00 -0700
commitd51503ad1885e6a8dac46b4054260682eec261fe (patch)
treef32228b495adb2230d2bcdea29932f683d79e305 /app/controllers/solidus_subscriptions/api/v1/line_items_controller.rb
parent0b1cb37a624315c0f731afeb47e44b0d98616daa (diff)
Remove error handling
There is no forseen case where a subscription line item belonging to an incomplete order could not be destroyed
Diffstat (limited to 'app/controllers/solidus_subscriptions/api/v1/line_items_controller.rb')
-rw-r--r--app/controllers/solidus_subscriptions/api/v1/line_items_controller.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/controllers/solidus_subscriptions/api/v1/line_items_controller.rb b/app/controllers/solidus_subscriptions/api/v1/line_items_controller.rb
index d7a59aa..ed32f78 100644
--- a/app/controllers/solidus_subscriptions/api/v1/line_items_controller.rb
+++ b/app/controllers/solidus_subscriptions/api/v1/line_items_controller.rb
@@ -14,11 +14,9 @@ class SolidusSubscriptions::Api::V1::LineItemsController < Spree::Api::BaseContr
def destroy
authorize! :manage, @line_item
return render json: {}, status: 400 if @line_item.order.complete?
- if @line_item.destroy
- render json: @line_item.to_json
- else
- render json: @line_item.errors.to_json, status: 500
- end
+
+ @line_item.destroy!
+ render json: @line_item.to_json
end
private