Sha256: fbf9dc904ec2a0373e216f5f54458fc61cc89114f0322a12637683518d9afd08

Contents?: true

Size: 754 Bytes

Versions: 4

Compression:

Stored size: 754 Bytes

Contents

module Comee
  module Core
    class ClientPricesController < ApplicationController
      include Comee::Core::Common

      def index
        super do
          client_prices = Comee::Core::ClientPrice.all
          client_prices.then(&paginate)
        end
      end

      def filter
        @client_prices = Comee::Core::ClientPrice.ransack(params[:q]).result
        @client_prices = @client_prices.then(&paginate)
        render json: {success: true, data: serialize(@client_prices)}
      end

      private

      def model_params
        params.require(:payload).permit(:valid_from, :valid_to, :price, :product_id, :margin, :margin_type, :client_id, :previous_price,
                                        :unit_id)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
comee_core-0.1.69 app/controllers/comee/core/client_prices_controller.rb
comee_core-0.1.68 app/controllers/comee/core/client_prices_controller.rb
comee_core-0.1.67 app/controllers/comee/core/client_prices_controller.rb
comee_core-0.1.66 app/controllers/comee/core/client_prices_controller.rb