From 8fe2a290ba7aca3ecf553f4f5e13b890f61cdfa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl-Gerhard=20Lindesva=CC=88rd?= Date: Mon, 24 Jun 2024 21:53:31 +0200 Subject: [PATCH] do not show event id when only on series --- packages/trpc/src/routers/chart.helpers.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/trpc/src/routers/chart.helpers.ts b/packages/trpc/src/routers/chart.helpers.ts index 89c429ef..73cac51c 100644 --- a/packages/trpc/src/routers/chart.helpers.ts +++ b/packages/trpc/src/routers/chart.helpers.ts @@ -502,9 +502,6 @@ export async function getChartSeries(input: IChartInputWithDates) { } export async function getChart(input: IChartInput) { - const includeEventName = - uniq(pluck('name', input.events)).length !== - pluck('name', input.events).length; const currentPeriod = getChartStartEndDate(input); const previousPeriod = getChartPrevStartEndDate({ range: input.range, @@ -529,6 +526,9 @@ export async function getChart(input: IChartInput) { const previousSeries = result[1]; const limit = input.limit || 300; const offset = input.offset || 0; + const includeEventName = + uniq(pluck('name', input.events)).length !== + pluck('name', input.events).length && series.length > 1; const final: FinalChart = { series: series.map((serie) => { const previousSerie = previousSeries?.find(