Add customizable tabular data exports
This commit is contained in:
1 parent
5d5781e707
commit
3e6cd85662
15 files changed
+312
-40
No files matched your search
@@ -31,6 +31,7 @@ export async function downloadApiFile(
|
||||
path: string,
|
||||
fallbackName: string,
|
||||
config?: AxiosRequestConfig,
|
||||
customName?: string,
|
||||
) {
|
||||
const response = await http.get(path, {
|
||||
...config,
|
||||
@@ -44,7 +45,7 @@ export async function downloadApiFile(
|
||||
const url = URL.createObjectURL(response.data)
|
||||
const anchor = document.createElement('a')
|
||||
anchor.href = url
|
||||
anchor.download = responseFileName(
|
||||
anchor.download = customName || responseFileName(
|
||||
response.headers['content-disposition'], uniqueFallbackName(path, fallbackName),
|
||||
)
|
||||
document.body.appendChild(anchor)
|
||||
|
||||
Reference in new issue
Block a user