diff options
author | Alessandro Desantis <desa.alessandro@gmail.com> | 2020-06-17 16:44:14 +0200 |
---|---|---|
committer | Alessandro Desantis <desa.alessandro@gmail.com> | 2020-06-17 17:40:05 +0200 |
commit | bc5de6e55298d5774dd65d91924cad1c8e4fa8a5 (patch) | |
tree | ee065892626c62d2fb173dba7ad122aa1769b5f9 /app/controllers | |
parent | 89889bfe084303d295c0de365b8c899e334a08e1 (diff) |
Allow setting subscription interval and end date via the API
Once a subscription is created, the interval and end date are not
read from the line items anymore, but rather from the subscription
itself. Therefore, users should be allowed to edit the interval and
end date on the subscription, and forbidden from editing it on the
line items, which will have no effect.
See issue [#114](https://github.com/solidusio-contrib/solidus_subscriptions/issues/114)
for more details about the matter.
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/solidus_subscriptions/api/v1/subscriptions_controller.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/controllers/solidus_subscriptions/api/v1/subscriptions_controller.rb b/app/controllers/solidus_subscriptions/api/v1/subscriptions_controller.rb index ca86932..8db616d 100644 --- a/app/controllers/solidus_subscriptions/api/v1/subscriptions_controller.rb +++ b/app/controllers/solidus_subscriptions/api/v1/subscriptions_controller.rb @@ -35,6 +35,9 @@ class SolidusSubscriptions::Api::V1::SubscriptionsController < Spree::Api::BaseC def subscription_params params.require(:subscription).permit( + :interval_units, + :interval_length, + :end_date, line_items_attributes: line_item_attributes, shipping_address_attributes: Spree::PermittedAttributes.address_attributes, billing_address_attributes: Spree::PermittedAttributes.address_attributes, |