hashing reps and submission blobs
This commit is contained in:
+7
-2
@@ -795,10 +795,11 @@ export const getAwaitingSubmissionFromBlob = (containerName) => {
|
|||||||
|
|
||||||
export const getRepsFromBlob = (containerName) => {
|
export const getRepsFromBlob = (containerName) => {
|
||||||
console.log(
|
console.log(
|
||||||
"///////////////////////getRepsFromBlob: " +
|
"///////////////////////\ngetRepsFromBlob: " +
|
||||||
containerName +
|
containerName +
|
||||||
"\n///////////////////////\n"
|
"\n///////////////////////\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
@@ -819,7 +820,11 @@ export const getAwaitingSubmissionFromBlobProxy = (containerName) => {
|
|||||||
.get(
|
.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/file/getawaitingsubmissionfromblob?container=" +
|
"/api/file/getawaitingsubmissionfromblob?container=" +
|
||||||
containerName
|
containerName +
|
||||||
|
+hashAPIPath(
|
||||||
|
"/api/file/getawaitingsubmissionfromblob?container=" +
|
||||||
|
containerName
|
||||||
|
)
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
return res.data;
|
return res.data;
|
||||||
|
|||||||
@@ -23,19 +23,19 @@ ApiProxy.get(async (req, res) => {
|
|||||||
"\n///////////////////////\n"
|
"\n///////////////////////\n"
|
||||||
);
|
);
|
||||||
// console.log(hashAPIPath(checkquerypath), checkHash);
|
// console.log(hashAPIPath(checkquerypath), checkHash);
|
||||||
// console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
|
//console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
|
||||||
|
|
||||||
//if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
|
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
|
||||||
const blobObj = await getAllProgressBlobs(containerName)
|
const blobObj = await getAllProgressBlobs(containerName)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
return downloadAllProgressFiles(containerName, data);
|
return downloadAllProgressFiles(containerName, data);
|
||||||
})
|
})
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
return res.status(200).json(data);
|
return res.status(200).json(data);
|
||||||
});
|
});
|
||||||
// } else {
|
} else {
|
||||||
// return res.status(400).json();
|
return res.status(400).json();
|
||||||
// }
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import nextConnect from "next-connect";
|
import nextConnect from "next-connect";
|
||||||
import middleware from "../middleware/middleware";
|
import middleware from "../middleware/middleware";
|
||||||
|
import { hashAPIPath } from "../../../actions";
|
||||||
|
|
||||||
const ApiProxy = nextConnect();
|
const ApiProxy = nextConnect();
|
||||||
ApiProxy.use(middleware);
|
ApiProxy.use(middleware);
|
||||||
@@ -14,30 +15,19 @@ ApiProxy.get(async (req, res) => {
|
|||||||
var casefolderID = req.query.casefolderID;
|
var casefolderID = req.query.casefolderID;
|
||||||
|
|
||||||
var checkHash = req.query.hash;
|
var checkHash = req.query.hash;
|
||||||
var checkquerypath =
|
var checkquerypath = "/api/file/getrepsblob?container=" + containerName;
|
||||||
"/api/file/getrepsblob?container=" +
|
|
||||||
containerName +
|
|
||||||
"&casefolderID=" +
|
|
||||||
casefolderID;
|
|
||||||
|
|
||||||
console.log(checkquerypath);
|
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
|
||||||
// console.log(hashAPIPath(checkquerypath), checkHash);
|
const blobObj = await getRepslobs(containerName, casefolderID)
|
||||||
// console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
|
.then((data) => {
|
||||||
|
return downloadAllRepsFiles(containerName, data);
|
||||||
//if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
|
})
|
||||||
const blobObj = await getRepslobs(containerName, casefolderID)
|
.then((data) => {
|
||||||
.then((data) => {
|
return res.status(200).json(data);
|
||||||
console.log("reps blob", data);
|
});
|
||||||
|
} else {
|
||||||
return downloadAllRepsFiles(containerName, data);
|
return res.status(400).json();
|
||||||
})
|
}
|
||||||
.then((data) => {
|
|
||||||
return res.status(200).json(data);
|
|
||||||
});
|
|
||||||
|
|
||||||
// } else {
|
|
||||||
// return res.status(400).json();
|
|
||||||
// }
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
|
|||||||
Reference in New Issue
Block a user