From b0b3e5e895cf8d5844f6ec86bd26bde8cd73ee03 Mon Sep 17 00:00:00 2001 From: Karl-Aksel Puulmann Date: Sat, 2 Mar 2024 14:51:18 +0200 Subject: [PATCH] Use common pagination util --- lib/plausible/stats/breakdown.ex | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/plausible/stats/breakdown.ex b/lib/plausible/stats/breakdown.ex index 514f855b1..856c88a48 100644 --- a/lib/plausible/stats/breakdown.ex +++ b/lib/plausible/stats/breakdown.ex @@ -62,9 +62,6 @@ defmodule Plausible.Stats.Breakdown do [] end - {limit, page} = pagination - offset = (page - 1) * limit - page_results = if Enum.any?(pageview_goals) do page_exprs = Enum.map(pageview_goals, & &1.page_path) @@ -72,8 +69,6 @@ defmodule Plausible.Stats.Breakdown do from(e in base_event_query(site, query), order_by: [desc: fragment("uniq(?)", e.user_id)], - limit: ^limit, - offset: ^offset, where: fragment( "notEmpty(multiMatchAllIndices(?, ?) as indices)", @@ -88,6 +83,7 @@ defmodule Plausible.Stats.Breakdown do ) |> select_event_metrics(metrics_to_select -- @revenue_metrics) |> add_revenue_as_nil_selects(metrics_to_select) + |> apply_pagination(pagination) |> ClickhouseRepo.all() else []