From 7401e34c524c006b8fdfa9f39c48b8543f2b31d5 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sat, 7 Nov 2020 01:41:33 +0000 Subject: [PATCH] Fix credit cards strong params --- app/controllers/api/customers_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/customers_controller.rb b/app/controllers/api/customers_controller.rb index 172d4580b8..796032e763 100644 --- a/app/controllers/api/customers_controller.rb +++ b/app/controllers/api/customers_controller.rb @@ -11,11 +11,15 @@ module Api @customer = Customer.find(params[:id]) authorize! :update, @customer - if @customer.update(params[:customer]) + if @customer.update(customer_params) render json: @customer, serializer: CustomerSerializer, status: :ok else invalid_resource!(@customer) end end + + def customer_params + params.require(:customer).permit(:code, :email, :enterprise_id, :allow_charges) + end end end