Merge commit '930aa9fee26bf9eaefe27826fa1061288d83373b' into glitch-soc/stable-4.6
This commit is contained in:
commit
2be3994558
12 files changed
+70
-22
No files matched your search
@@ -17,9 +17,9 @@ class Api::V1::Admin::MeasuresController < Api::BaseController
|
||||
|
||||
def set_measures
|
||||
@measures = Admin::Metrics::Measure.retrieve(
|
||||
params[:keys],
|
||||
params[:start_at],
|
||||
params[:end_at],
|
||||
params.require(:keys),
|
||||
params.require(:start_at),
|
||||
params.require(:end_at),
|
||||
params
|
||||
)
|
||||
end
|
||||
|
||||
@@ -4,22 +4,22 @@ class Api::V1::Admin::RetentionController < Api::BaseController
|
||||
include Authorization
|
||||
|
||||
before_action -> { authorize_if_got_token! :'admin:read' }
|
||||
before_action :set_cohorts
|
||||
before_action :set_retention
|
||||
|
||||
after_action :verify_authorized
|
||||
|
||||
def create
|
||||
authorize :dashboard, :index?
|
||||
render json: @cohorts, each_serializer: REST::Admin::CohortSerializer
|
||||
render json: @retention.cohorts, each_serializer: REST::Admin::CohortSerializer
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_cohorts
|
||||
@cohorts = Admin::Metrics::Retention.new(
|
||||
params[:start_at],
|
||||
params[:end_at],
|
||||
def set_retention
|
||||
@retention = Admin::Metrics::Retention.new(
|
||||
params.require(:start_at),
|
||||
params.require(:end_at),
|
||||
params[:frequency]
|
||||
).cohorts
|
||||
)
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user