From 383cdbf9b760517c6cadb936b8f373b48eb104e8 Mon Sep 17 00:00:00 2001 From: Sanjeev Lakhwani Date: Thu, 21 Dec 2023 14:55:05 -0500 Subject: [PATCH] Ensured that there is no duplication of data --- src/js/features/data/makeGetDataRequest.thunk.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/features/data/makeGetDataRequest.thunk.ts b/src/js/features/data/makeGetDataRequest.thunk.ts index 8768fcc9..b72d9b0c 100644 --- a/src/js/features/data/makeGetDataRequest.thunk.ts +++ b/src/js/features/data/makeGetDataRequest.thunk.ts @@ -29,12 +29,12 @@ export const makeGetDataRequestThunk = createAsyncThunk< // + field definition (from config.field) // + the fields' relevant data. const normalizeChart = (chart: ChartConfig, i: number): ChartDataField => { - const field = overviewResponse.fields[chart.field]; + const { data, ...field } = overviewResponse.fields[chart.field]; return { id: field.id, chartConfig: chart, field, - data: serializeChartData(field.data), + data: serializeChartData(data), // Initial display state isDisplayed: i < MAX_CHARTS, width: chart.width ?? DEFAULT_CHART_WIDTH, // initial configured width; users can change it from here