add budget investment stats
This commit is contained in:
@@ -4,7 +4,8 @@ class Admin::Api::StatsController < Admin::Api::BaseController
|
||||
unless params[:event].present? ||
|
||||
params[:visits].present? ||
|
||||
params[:spending_proposals].present? ||
|
||||
params[:budget_investments].present?
|
||||
params[:budget_investments].present? ||
|
||||
params[:user_supported_budgets].present?
|
||||
return render json: {}, status: :bad_request
|
||||
end
|
||||
|
||||
@@ -26,6 +27,9 @@ class Admin::Api::StatsController < Admin::Api::BaseController
|
||||
ds.add "Budget Investments", Budget::Investment.group_by_day(:created_at).count
|
||||
end
|
||||
|
||||
if params[:user_supported_budgets].present?
|
||||
ds.add "User supported budgets", Vote.where(votable_type: "Budget::Investment").group_by_day(:updated_at).count
|
||||
end
|
||||
render json: ds.build
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user