Skip to content

Commit

Permalink
Ensured that there is no duplication of data
Browse files Browse the repository at this point in the history
  • Loading branch information
SanjeevLakhwani committed Dec 21, 2023
1 parent 707fba6 commit 383cdbf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/features/data/makeGetDataRequest.thunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 383cdbf

Please sign in to comment.