Merge pull request #4964 from luisramos0/po_fix

Fix proxy orders controller in rails 4 by removing the use of responders
This commit is contained in:
Luis Ramos
2020-04-09 10:12:33 +01:00
committed by GitHub
2 changed files with 6 additions and 13 deletions

View File

@@ -33,7 +33,6 @@ Layout/LineLength:
- app/controllers/admin/inventory_items_controller.rb
- app/controllers/admin/manager_invitations_controller.rb
- app/controllers/admin/product_import_controller.rb
- app/controllers/admin/proxy_orders_controller.rb
- app/controllers/admin/schedules_controller.rb
- app/controllers/admin/subscriptions_controller.rb
- app/controllers/admin/variant_overrides_controller.rb

View File

@@ -9,25 +9,19 @@ module Admin
def cancel
if @proxy_order.cancel
respond_with(@proxy_order) do |format|
format.json { render_as_json @proxy_order }
end
render_as_json @proxy_order
else
respond_with(@proxy_order) do |format|
format.json { render json: { errors: [t('admin.proxy_orders.cancel.could_not_cancel_the_order')] }, status: :unprocessable_entity }
end
render json: { errors: [t('admin.proxy_orders.cancel.could_not_cancel_the_order')] },
status: :unprocessable_entity
end
end
def resume
if @proxy_order.resume
respond_with(@proxy_order) do |format|
format.json { render_as_json @proxy_order }
end
render_as_json @proxy_order
else
respond_with(@proxy_order) do |format|
format.json { render json: { errors: [t('admin.proxy_orders.resume.could_not_resume_the_order')] }, status: :unprocessable_entity }
end
render json: { errors: [t('admin.proxy_orders.resume.could_not_resume_the_order')] },
status: :unprocessable_entity
end
end
end