Skip to content

Commit

Permalink
fix: visualization deleted when saving it after copy DHIS2-15722
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardo committed Sep 14, 2023
1 parent db83177 commit 49d0100
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
DIMENSION_ID_PERIOD,
DIMENSION_ID_ORGUNIT,
DIMENSION_ID_ASSIGNED_CATEGORIES,
preparePayloadForSaveAs,

Check failure on line 9 in src/actions/index.js

View workflow job for this annotation

GitHub Actions / lint

preparePayloadForSaveAs not found in '@dhis2/analytics'
} from '@dhis2/analytics'
import i18n from '@dhis2/d2-i18n'
import { apiPostDataStatistics } from '../api/dataStatistics.js'
Expand Down Expand Up @@ -204,13 +205,13 @@ export const tDoSaveVisualization =

try {
dispatch(fromLoader.acSetPluginLoading(true))
const visualization = getVisualizationFromCurrent(
let visualization = getVisualizationFromCurrent(
sGetCurrent(getState())
)

// remove the id to trigger a POST request and save a new AO
if (copy) {
delete visualization.id
visualization = preparePayloadForSaveAs(visualization)
}

visualization.name =
Expand Down

0 comments on commit 49d0100

Please sign in to comment.