Skip to content

Commit

Permalink
fix: cleanup AO before creating a copy DHIS2-15722
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardo committed Sep 26, 2023
1 parent 181e20e commit ba571ee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/Toolbar/MenuBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
getDisplayNameByVisType,
useCachedDataQuery,
FileMenu,
preparePayloadForSaveAs,
HoverMenuBar,
} from '@dhis2/analytics'
import { useAlert, useDataMutation } from '@dhis2/app-runtime'
Expand Down Expand Up @@ -165,9 +166,9 @@ export const MenuBar = ({ onFileMenuAction }) => {
}

if (copy) {
delete visualization.id

postVisualization({ visualization })
postVisualization({
visualization: preparePayloadForSaveAs(visualization),
})
} else {
putVisualization({ visualization })
}
Expand Down

0 comments on commit ba571ee

Please sign in to comment.