hashing reps and submission blobs

This commit is contained in:
2023-01-27 11:57:15 +00:00
parent 2a5ea53536
commit 061fd71e1e
3 changed files with 32 additions and 37 deletions
+7 -2
View File
@@ -795,10 +795,11 @@ export const getAwaitingSubmissionFromBlob = (containerName) => {
export const getRepsFromBlob = (containerName) => {
console.log(
"///////////////////////getRepsFromBlob: " +
"///////////////////////\ngetRepsFromBlob: " +
containerName +
"\n///////////////////////\n"
);
return axios
.get(
BASE_URL +
@@ -819,7 +820,11 @@ export const getAwaitingSubmissionFromBlobProxy = (containerName) => {
.get(
BASE_URL +
"/api/file/getawaitingsubmissionfromblob?container=" +
containerName
containerName +
+hashAPIPath(
"/api/file/getawaitingsubmissionfromblob?container=" +
containerName
)
)
.then((res) => {
return res.data;
+12 -12
View File
@@ -23,19 +23,19 @@ ApiProxy.get(async (req, res) => {
"\n///////////////////////\n"
);
// console.log(hashAPIPath(checkquerypath), checkHash);
// console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
//console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
//if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
const blobObj = await getAllProgressBlobs(containerName)
.then((data) => {
return downloadAllProgressFiles(containerName, data);
})
.then((data) => {
return res.status(200).json(data);
});
// } else {
// return res.status(400).json();
// }
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
const blobObj = await getAllProgressBlobs(containerName)
.then((data) => {
return downloadAllProgressFiles(containerName, data);
})
.then((data) => {
return res.status(200).json(data);
});
} else {
return res.status(400).json();
}
});
export const config = {
+13 -23
View File
@@ -5,6 +5,7 @@ import {
import _ from "lodash";
import nextConnect from "next-connect";
import middleware from "../middleware/middleware";
import { hashAPIPath } from "../../../actions";
const ApiProxy = nextConnect();
ApiProxy.use(middleware);
@@ -14,30 +15,19 @@ ApiProxy.get(async (req, res) => {
var casefolderID = req.query.casefolderID;
var checkHash = req.query.hash;
var checkquerypath =
"/api/file/getrepsblob?container=" +
containerName +
"&casefolderID=" +
casefolderID;
var checkquerypath = "/api/file/getrepsblob?container=" + containerName;
console.log(checkquerypath);
// console.log(hashAPIPath(checkquerypath), checkHash);
// console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
//if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
const blobObj = await getRepslobs(containerName, casefolderID)
.then((data) => {
console.log("reps blob", data);
return downloadAllRepsFiles(containerName, data);
})
.then((data) => {
return res.status(200).json(data);
});
// } else {
// return res.status(400).json();
// }
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
const blobObj = await getRepslobs(containerName, casefolderID)
.then((data) => {
return downloadAllRepsFiles(containerName, data);
})
.then((data) => {
return res.status(200).json(data);
});
} else {
return res.status(400).json();
}
});
export const config = {