updated storage account stuff to take auth id

This commit is contained in:
2022-08-26 15:19:34 +01:00
parent 671d49c394
commit 862a953aae
18 changed files with 346 additions and 133 deletions
+40 -11
View File
@@ -132,6 +132,7 @@ export const azureHeadersPagedCustom = (access_token, showNumberOfRecords) => {
};
export const hashAPIPath = (queryPath) => {
console.log(queryPath);
var hashlink = CryptoJS.HmacSHA256(
queryPath,
CryptoJS.enc.Hex.parse(WORDKEY)
@@ -1040,12 +1041,19 @@ export const createAccount = (formValues) => {
});
};
export const uploadFiles = async (formValues, filesObj, uploadhash) => {
export const uploadFiles = async (
formValues,
filesObj,
containerID,
casefolderID
) => {
let files = filesObj;
//console.log(formValues);
var formData = new FormData();
formData.append("appealData", JSON.stringify(formValues));
formData.append("containerID", containerID);
formData.append("casefolderID", casefolderID);
// files.forEach((file) => formData.append("files", file));
@@ -1076,15 +1084,19 @@ export const uploadFiles = async (formValues, filesObj, uploadhash) => {
}
};
export const getFilesFromBlob = (containerName) => {
export const getFilesFromBlob = (containerName, casefolderID) => {
return axios
.get(
BASE_URL +
"/api/file/getbloblist?container=" +
containerName.toLowerCase() +
containerName +
"&casefolderID=" +
casefolderID +
hashAPIPath(
"/api/file/getbloblist?container=" +
containerName.toLowerCase()
containerName +
"&casefolderID=" +
casefolderID
)
)
.then((res) => {
@@ -1096,12 +1108,18 @@ export const getFilesFromBlob = (containerName) => {
});
};
export const getFilesFromBlobHashed = (containerName, getblobshash) => {
export const getFilesFromBlobHashed = (
containerName,
getblobshash,
casefolderID
) => {
return axios
.get(
BASE_URL +
"/api/file/getbloblist?container=" +
containerName.toLowerCase() +
containerName +
"&casefolderID=" +
casefolderID +
getblobshash
)
.then((res) => {
@@ -1113,12 +1131,19 @@ export const getFilesFromBlobHashed = (containerName, getblobshash) => {
});
};
export const deleteBlob = async (containerName, blobName, deleteblobhash) => {
export const deleteBlob = async (
containerName,
blobName,
deleteblobhash,
casefolderID
) => {
try {
const res = await axios.get(
BASE_URL +
"/api/file/deleteblob?container=" +
containerName.toLowerCase() +
containerName +
"&casefolderID=" +
casefolderID +
"&blobname=" +
blobName +
deleteblobhash
@@ -1155,16 +1180,20 @@ export const downloadBlob = (containerName, blobName) => {
});
};
export const getProgressFromBlob = async (containerName) => {
export const getProgressFromBlob = async (containerName, casereference) => {
console.log("cont:", containerName);
try {
const res = await axios.get(
BASE_URL +
"/api/file/getprogressobjblob?container=" +
containerName.toLowerCase() +
containerName +
"&casefolderID=" +
casereference +
hashAPIPath(
"/api/file/getprogressobjblob?container=" +
containerName.toLowerCase()
containerName +
"&casefolderID=" +
casereference
)
);
return res.data;