diff --git a/app/controllers/concerns/countable.rb b/app/controllers/concerns/countable.rb index 00e26d9db..39bcfdb79 100644 --- a/app/controllers/concerns/countable.rb +++ b/app/controllers/concerns/countable.rb @@ -15,7 +15,11 @@ def doi_count(client_id: nil, provider_id: nil, consortium_id: nil, researcher_i response = Doi.query(nil, page: { number: 1, size: 0 }) end - response.results.total > 0 ? facet_by_year(response.response.aggregations.created.buckets) : [] + if researcher_id + response.results.total > 0 ? facet_by_cumulative_year(response.response.aggregations.created.buckets) : [] + else + response.results.total > 0 ? facet_by_year(response.response.aggregations.created.buckets) : [] + end end # cumulative count clients by year