upodated rep file upload

This commit is contained in:
2024-12-18 12:39:17 +00:00
parent 54728d9565
commit 97cfeb562a
13 changed files with 433 additions and 108 deletions
+12 -4
View File
@@ -30,7 +30,7 @@
*/
import { hashAPIPath } from "../../../actions";
import { getBlobs } from "../../../actions/azurestorage";
import { getBlobs, getRepsFilesBlobs } from "../../../actions/azurestorage";
import nextConnect from "next-connect";
import middleware from "../middleware/middleware";
@@ -57,9 +57,17 @@ ApiProxy.get(async (req, res) => {
// console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
await getBlobs(containerName, casefolderID).then((data) => {
return res.status(200).json({ "value": [data] });
});
casefolderID.split("/").length > 1
? await getRepsFilesBlobs(
containerName,
casefolderID.split("/")[0],
casefolderID.split("/")[1]
).then((data) => {
return res.status(200).json({ "value": [data] });
})
: await getBlobs(containerName, casefolderID).then((data) => {
return res.status(200).json({ "value": [data] });
});
} else {
return res.status(400).json();
}