delet blob wip
This commit is contained in:
@@ -170,6 +170,35 @@ export const deleteBlob = async (containerName, blobName) => {
|
||||
return { "deleted": blobName };
|
||||
};
|
||||
|
||||
export const deleteBlobCase = async (containerName, blobName) => {
|
||||
const creds = new DefaultAzureCredential();
|
||||
|
||||
const options = {
|
||||
deleteSnapshots: "include", // or 'only'
|
||||
};
|
||||
|
||||
const containerClient = new ContainerClient(
|
||||
`${STORAGE_PATH}/${containerName}`,
|
||||
creds
|
||||
);
|
||||
|
||||
console.log("blob to delete:", blobName);
|
||||
|
||||
for await (const blob of containerClient.listBlobsFlat({
|
||||
prefix: blobName,
|
||||
})) {
|
||||
console.log(" ------ :", blob.name);
|
||||
containerClient.deleteBlob(blob.name);
|
||||
}
|
||||
|
||||
containerClient.deleteBlob(blobName);
|
||||
console.log(`deleted blob ${blobName}`);
|
||||
for await (const blob of containerClient.listBlobsFlat()) {
|
||||
console.log(" ------ :", blob.name);
|
||||
}
|
||||
return { "deleted": blobName };
|
||||
};
|
||||
|
||||
export const uploadFile = async (formContent, containerName, foldername) => {
|
||||
const creds = new DefaultAzureCredential();
|
||||
|
||||
|
||||
+16
-6
@@ -743,12 +743,22 @@ export const getAwaitingSubmissionProxy = (loggedInUserId) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getAwaitingSubmissionFromBlobProxy = (containerName) => {
|
||||
return axios
|
||||
.get(
|
||||
BASE_URL +
|
||||
"/api/file/getawaitingsubmissionfromblob?container=" +
|
||||
containerName
|
||||
)
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
//console.log("API call error", error);
|
||||
});
|
||||
};
|
||||
|
||||
export const getAwaitingSubmission = (loggedInUserId) => {
|
||||
console.log(
|
||||
BASE_URL +
|
||||
"/api/endpoint/getawaitingsubmission_api?loggedInUserId=" +
|
||||
loggedInUserId
|
||||
);
|
||||
return axios
|
||||
.get(
|
||||
BASE_URL +
|
||||
@@ -1041,7 +1051,7 @@ export const deleteAwaitingSubmissionsFromBlob = (
|
||||
casefolderID
|
||||
) => {
|
||||
var queryUrl =
|
||||
"/api/file/deleteawaitingsubmissionsfromblob?container=" +
|
||||
"/api/file/deleteblobcase?container=" +
|
||||
containerID +
|
||||
"&casefolderID=" +
|
||||
casefolderID;
|
||||
|
||||
Reference in New Issue
Block a user