From 37a3905455cc4047696ff1086478999bbb33b6ae Mon Sep 17 00:00:00 2001 From: Edoardo Sabadelli Date: Fri, 8 Sep 2023 12:23:34 +0200 Subject: [PATCH] fix: export function for preparing payload for copy DHIS2-15722 --- src/components/FileMenu/utils.js | 8 ++++++++ src/index.js | 1 + 2 files changed, 9 insertions(+) diff --git a/src/components/FileMenu/utils.js b/src/components/FileMenu/utils.js index 7cca04a9d..7fe272aed 100644 --- a/src/components/FileMenu/utils.js +++ b/src/components/FileMenu/utils.js @@ -39,3 +39,11 @@ export const appPathFor = (fileType, id) => { return `${window.location.search}${window.location.hash}` } } + +export const preparePayloadForSaveAs = ({ ...visualization }) => { + delete visualization.id + delete visualization.created + delete visualization.createdBy + + return visualization +} diff --git a/src/index.js b/src/index.js index 069656b77..8db29cbb2 100644 --- a/src/index.js +++ b/src/index.js @@ -22,6 +22,7 @@ export { default as DimensionMenu } from './components/DimensionMenu.js' export { default as PivotTable } from './components/PivotTable/PivotTable.js' export { default as FileMenu } from './components/FileMenu/FileMenu.js' +export { preparePayloadForSaveAs } from './components/FileMenu/utils.js' export { default as VisTypeIcon } from './components/VisTypeIcon.js'