Skip to content

Commit 6df22f4

Browse files
Merge pull request #1075 from Chia-Network/develop
Release 1.1.3
2 parents eb7941d + 236cde2 commit 6df22f4

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cadt-ui",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"private": true,
55
"author": "Chia Network Inc. <[email protected]>",
66
"homepage": "./",

src/store/actions/climateWarehouseActions.js

+2
Original file line numberDiff line numberDiff line change
@@ -2595,6 +2595,8 @@ const fetchWrapper = async (url, payload) => {
25952595
return fetch(url, payload);
25962596
};
25972597

2598+
export { fetchWrapper };
2599+
25982600
const formatApiErrorResponse = (
25992601
{ errors, message, error },
26002602
alternativeResponseId,

src/utils/xlsxUtils.js

+21-20
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
import constants from '../constants';
2-
3-
export const downloadTxtFile = async (type, searchParams) => {
4-
searchParams.delete('myRegistry');
5-
await fetch(
6-
`${
7-
constants.API_HOST
8-
}/${`${type}?`}${`${searchParams.toString()}&`}xls=true`,
9-
)
10-
.then(async result => await result.blob())
11-
.then(async response => {
12-
const filename = await response;
13-
const link = document.createElement('a');
14-
const url = window.URL.createObjectURL(new Blob([filename]));
15-
link.href = url;
16-
link.download = `${type}.xlsx`;
17-
document.body.appendChild(link); // Required for this to work in FireFox
18-
link.click();
19-
});
20-
};
1+
import constants from '../constants';
2+
import { fetchWrapper } from '../store/actions/climateWarehouseActions';
3+
4+
export const downloadTxtFile = async (type, searchParams) => {
5+
searchParams.delete('myRegistry');
6+
await fetchWrapper(
7+
`${
8+
constants.API_HOST
9+
}/${`${type}?`}${`${searchParams.toString()}&`}xls=true`,
10+
)
11+
.then(async result => await result.blob())
12+
.then(async response => {
13+
const filename = await response;
14+
const link = document.createElement('a');
15+
const url = window.URL.createObjectURL(new Blob([filename]));
16+
link.href = url;
17+
link.download = `${type}.xlsx`;
18+
document.body.appendChild(link); // Required for this to work in FireFox
19+
link.click();
20+
});
21+
};

0 commit comments

Comments
 (0)