summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlessandro Desantis <desa.alessandro@gmail.com>2020-10-07 16:39:01 +0200
committerAlessandro Desantis <desa.alessandro@gmail.com>2020-10-08 13:34:54 +0200
commitc64e18ea9ebadda5d6be746faf999ea86fc5176a (patch)
tree2d821e57e8074f437af842df19979aefea152cd3 /app
parent2540d1fe9123c032a8094047cd4808d508bdadd2 (diff)
Implement a base API controller class
Diffstat (limited to 'app')
-rw-r--r--app/controllers/solidus_subscriptions/api/v1/base_controller.rb8
-rw-r--r--app/controllers/solidus_subscriptions/api/v1/line_items_controller.rb2
-rw-r--r--app/controllers/solidus_subscriptions/api/v1/subscriptions_controller.rb2
3 files changed, 10 insertions, 2 deletions
diff --git a/app/controllers/solidus_subscriptions/api/v1/base_controller.rb b/app/controllers/solidus_subscriptions/api/v1/base_controller.rb
new file mode 100644
index 0000000..511d361
--- /dev/null
+++ b/app/controllers/solidus_subscriptions/api/v1/base_controller.rb
@@ -0,0 +1,8 @@
+module SolidusSubscriptions
+ module Api
+ module V1
+ class BaseController < ::Spree::Api::BaseController
+ end
+ end
+ end
+end
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 8e6ff34..7221b7b 100644
--- a/app/controllers/solidus_subscriptions/api/v1/line_items_controller.rb
+++ b/app/controllers/solidus_subscriptions/api/v1/line_items_controller.rb
@@ -3,7 +3,7 @@
module SolidusSubscriptions
module Api
module V1
- class LineItemsController < ::Spree::Api::BaseController
+ class LineItemsController < BaseController
before_action :load_line_item, only: [:update, :destroy]
wrap_parameters :subscription_line_item
diff --git a/app/controllers/solidus_subscriptions/api/v1/subscriptions_controller.rb b/app/controllers/solidus_subscriptions/api/v1/subscriptions_controller.rb
index 3f0c384..a28f38f 100644
--- a/app/controllers/solidus_subscriptions/api/v1/subscriptions_controller.rb
+++ b/app/controllers/solidus_subscriptions/api/v1/subscriptions_controller.rb
@@ -3,7 +3,7 @@
module SolidusSubscriptions
module Api
module V1
- class SubscriptionsController < ::Spree::Api::BaseController
+ class SubscriptionsController < BaseController
before_action :load_subscription, only: [:cancel, :update, :skip]
protect_from_forgery unless: -> { request.format.json? }