added hashing on api calls

This commit is contained in:
2022-07-12 12:49:26 +01:00
parent f23ad2a300
commit be9f86b6b2
13 changed files with 234 additions and 158 deletions
+9
View File
@@ -85,6 +85,15 @@ export const getBlobs = async (containerName) => {
"&blobname=" +
blob.name.split("/")[1]
),
"hasheddeletepath": hashAPIPath(
"/api/file/deleteblob?container=" +
containerName.toLowerCase() +
"&blobname=" +
blob.name.split("/")[1]
),
"hashgetblobs": hashAPIPath(
"/api/file/getbloblist?container=" + containerName.toLowerCase()
),
});
}
+27 -5
View File
@@ -1024,7 +1024,7 @@ export const createAccount = (formValues) => {
});
};
export const uploadFiles = async (formValues, filesObj) => {
export const uploadFiles = async (formValues, filesObj, uploadhash) => {
let files = filesObj;
console.log(formValues);
@@ -1065,10 +1065,14 @@ export const getFilesFromBlob = (containerName) => {
.get(
BASE_URL +
"/api/file/getbloblist?container=" +
containerName.toLowerCase()
containerName.toLowerCase() +
hashAPIPath(
"/api/file/getbloblist?container=" +
containerName.toLowerCase()
)
)
.then((res) => {
console.log("//////////----", res.data);
//console.log("//////////----", res.data);
return res.data;
})
.catch((error) => {
@@ -1076,14 +1080,32 @@ export const getFilesFromBlob = (containerName) => {
});
};
export const deleteBlob = async (containerName, blobName) => {
export const getFilesFromBlobHashed = (containerName, getblobshash) => {
return axios
.get(
BASE_URL +
"/api/file/getbloblist?container=" +
containerName.toLowerCase() +
getblobshash
)
.then((res) => {
//console.log("//////////----", res.data);
return res.data;
})
.catch((error) => {
console.log("this serror", error);
});
};
export const deleteBlob = async (containerName, blobName, deleteblobhash) => {
try {
const res = await axios.get(
BASE_URL +
"/api/file/deleteblob?container=" +
containerName.toLowerCase() +
"&blobname=" +
blobName
blobName +
deleteblobhash
);
return res.data;
} catch (error) {