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
+12 -13
View File
@@ -1,35 +1,34 @@
import {
createContainer,
getContainers,
getBlobs,
createBlob,
uploadFile,
deleteBlob,
} from "../../../actions/azurestorage";
import { hashAPIPath } from "../../../actions";
import { deleteBlob } from "../../../actions/azurestorage";
import middleware from "../middleware/middleware";
import nextConnect from "next-connect";
import middleware from "../middleware/middleware";
const ApiProxy = nextConnect();
ApiProxy.use(middleware);
ApiProxy.get(async (req, res) => {
var containerName = req.query.container;
var casefolderID = req.query.casefolderID;
var blobName = req.query.blobname;
var checkHash = req.query.hash;
var checkquerypath =
"/api/file/deleteblob?container=" +
containerName.toLowerCase() +
containerName +
"&casefolderID=" +
casefolderID +
"&blobname=" +
blobName;
console.log(hashAPIPath(checkquerypath), checkHash);
console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
// console.log(hashAPIPath(checkquerypath), checkHash);
// console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
await deleteBlob(containerName, "files/" + blobName).then((data) => {
await deleteBlob(
containerName,
casefolderID + "/files/" + blobName
).then((data) => {
return res.status(200).json({ data: data });
});
} else {