refactor(actions): fix document download helper contract

This commit is contained in:
2026-03-25 09:57:26 +00:00
parent 4a49bbca09
commit 5309ffb8cf
2 changed files with 41 additions and 20 deletions
+13 -20
View File
@@ -1,4 +1,3 @@
import axios from "axios";
import { BASE_URL } from "../core/env";
import { consoleLogger } from "../core/logger";
import { hashAPIPath } from "../core/hash";
@@ -334,26 +333,20 @@ export const deleteRepBlob = async (
};
export const downloadBlob = (containerName, blobName) => {
return axios
.get(
BASE_URL +
"/api/file/downloadblob?container=" +
containerName.toLowerCase() +
"&blobname=" +
blobName,
{ responseType: "blob" }
)
.then((response) => {
res.setHeader(
"content-disposition",
"attachment; filename=" + blobName
);
const queryUrl =
BASE_URL +
"/api/file/downloadblob?container=" +
containerName.toLowerCase() +
"&blobname=" +
blobName;
return res.status(200).send(response.data);
})
.catch((error) => {
consoleLogger(error);
});
return requestJson({
method: "get",
url: queryUrl,
responseType: "blob"
}).catch((error) => {
consoleLogger(error);
});
};
export const getProgressFromBlob = async (containerName, casereference) => {