updated storage account stuff to take auth id
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user