Commit 57e0d474 authored by syasonik's avatar syasonik

Reduce congnitive complexity

parent 9a9cb253
...@@ -165,16 +165,15 @@ class Projects::EnvironmentsController < Projects::ApplicationController ...@@ -165,16 +165,15 @@ class Projects::EnvironmentsController < Projects::ApplicationController
result = Gitlab::MetricsDashboard::Service.new(@project, @current_user, environment: environment).get_dashboard result = Gitlab::MetricsDashboard::Service.new(@project, @current_user, environment: environment).get_dashboard
if result[:status] == :success if result[:status] == :success
render status: :ok, json: { status_code = :ok
status: :success, details = { dashboard: result[:dashboard] }
dashboard: result[:dashboard]
}
else else
render status: result[:http_status] || :bad_request, json: { status_code = result[:http_status] || :bad_request
message: result[:message], details = { message: result[:message] }
status: result[:status]
}
end end
render status: status_code,
json: { status: result[:status] }.merge(details)
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment