Skip to content

Commit

Permalink
feat: add monetary data show action
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed May 25, 2020
1 parent 655cc46 commit 4feedeb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/api/v1/distribution_data_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ module Api
module V1
class DistributionDataController < ApplicationController
before_action :validate_query_params, only: :show

def show
distribution_data = DistributionData.new
render json: DistributionDataSerializer.new(distribution_data, { params: { indicator: params[:id] } })
render json: DistributionDataSerializer.new(distribution_data, params: { indicator: params[:id] })
end

private
Expand Down
11 changes: 11 additions & 0 deletions app/controllers/api/v1/monetary_data_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Api
module V1
class MonetaryDataController < ApplicationController
def show
monetary_data = MonetaryData.new

render json: MonetaryDataSerializer.new(monetary_data, params: { indicator: params[:id] })
end
end
end
end
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
resources :udt_transactions, only: :show
resources :address_udt_transactions, only: :show
resources :distribution_data, only: :show
resources :monetary_data, only: :show
end
end

Expand Down

0 comments on commit 4feedeb

Please sign in to comment.