<commit_before>module Admin
  class ProxyOrdersController < ResourceController
    respond_to :json

    def edit
      @proxy_order.initialise_order! unless @proxy_order.order
      redirect_to spree.edit_admin_order_path(@proxy_order.order)
    end

    def cancel
      if @proxy_order.cancel
        respond_with(@proxy_order) do |format|
          format.json { render_as_json @proxy_order }
        end
      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
      end
    end

    def resume
      if @proxy_order.resume
        respond_with(@proxy_order) do |format|
          format.json { render_as_json @proxy_order }
        end
      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
      end
    end
  end
end
<commit_msg>Remove usage of the responder as this is a json only controller<commit_after>module Admin
  class ProxyOrdersController < ResourceController
    respond_to :json

    def edit
      @proxy_order.initialise_order! unless @proxy_order.order
      redirect_to spree.edit_admin_order_path(@proxy_order.order)
    end

    def cancel
      if @proxy_order.cancel
        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
      end
    end

    def resume
      if @proxy_order.resume
        render_as_json @proxy_order
      else
        render json: { errors: [t('admin.proxy_orders.resume.could_not_resume_the_order')] }, status: :unprocessable_entity
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.07616066770996348, 'fraction_numerical': 0.0, 'mean_word_length': 2.836, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1684096', 'n_tokens_mistral': 581, 'n_tokens_neox': 580, 'n_words': 130}