From 9911e78b505668214a82e35a888c499a4caba571 Mon Sep 17 00:00:00 2001 From: Tim Schipper Date: Wed, 16 Oct 2024 09:55:19 +0200 Subject: [PATCH] feat: add response.data and fix styling for layout with download zip button --- admin/src/components/ActionButtons/index.jsx | 5 ++++- admin/src/state/actions/Config.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/admin/src/components/ActionButtons/index.jsx b/admin/src/components/ActionButtons/index.jsx index 9c17c88..b69f18d 100644 --- a/admin/src/components/ActionButtons/index.jsx +++ b/admin/src/components/ActionButtons/index.jsx @@ -37,10 +37,10 @@ const ActionButtons = () => { )} onSubmit={(force) => dispatch(exportAllConfig(partialDiff, toggleNotification, formatMessage, post, get))} /> - {!isEmpty(partialDiff) && ( {Object.keys(partialDiff).length} {Object.keys(partialDiff).length === 1 ? "config change" : "config changes"} )} + ); }; @@ -53,6 +53,9 @@ const ActionButtonsStyling = styled.div` > button { margin-right: 10px; } + > button:last-of-type { + margin-left: auto; + } `; export default ActionButtons; diff --git a/admin/src/state/actions/Config.js b/admin/src/state/actions/Config.js index 1259709..73dbb0d 100644 --- a/admin/src/state/actions/Config.js +++ b/admin/src/state/actions/Config.js @@ -56,7 +56,7 @@ export function downloadZip(toggleNotification, formatMessage, post, get) { return async function(dispatch) { dispatch(setLoadingState(true)); try { - const { message, base64Data, name } = await get('/config-sync/zip'); + const { message, base64Data, name } = (await get('/config-sync/zip')).data; toggleNotification({ type: 'success', message }); if (base64Data) { saveAs(b64toBlob(base64Data, 'application/zip'), name, { type: 'application/zip' });