Skip to content

Commit a794d30

Browse files
authored
Merge pull request #1 from TMSchipper/fix/response-data
feat: add response.data and fix styling for layout with download zip …
2 parents 3a71083 + 9911e78 commit a794d30

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

admin/src/components/ActionButtons/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ const ActionButtons = () => {
3737
)}
3838
onSubmit={(force) => dispatch(exportAllConfig(partialDiff, toggleNotification, formatMessage, post, get))}
3939
/>
40-
<Button onClick={() => dispatch(downloadZip(toggleNotification, formatMessage, post, get))}>{formatMessage({ id: 'config-sync.Buttons.DownloadConfig' })}</Button>
4140
{!isEmpty(partialDiff) && (
4241
<Typography variant="epsilon">{Object.keys(partialDiff).length} {Object.keys(partialDiff).length === 1 ? "config change" : "config changes"}</Typography>
4342
)}
43+
<Button onClick={() => dispatch(downloadZip(toggleNotification, formatMessage, post, get))}>{formatMessage({ id: 'config-sync.Buttons.DownloadConfig' })}</Button>
4444
</ActionButtonsStyling>
4545
);
4646
};
@@ -53,6 +53,9 @@ const ActionButtonsStyling = styled.div`
5353
> button {
5454
margin-right: 10px;
5555
}
56+
> button:last-of-type {
57+
margin-left: auto;
58+
}
5659
`;
5760

5861
export default ActionButtons;

admin/src/state/actions/Config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function downloadZip(toggleNotification, formatMessage, post, get) {
5656
return async function(dispatch) {
5757
dispatch(setLoadingState(true));
5858
try {
59-
const { message, base64Data, name } = await get('/config-sync/zip');
59+
const { message, base64Data, name } = (await get('/config-sync/zip')).data;
6060
toggleNotification({ type: 'success', message });
6161
if (base64Data) {
6262
saveAs(b64toBlob(base64Data, 'application/zip'), name, { type: 'application/zip' });

0 commit comments

Comments
 (0)