console log cleanup

This commit is contained in:
2023-02-03 17:00:03 +00:00
parent cdc687959b
commit b8de41e592
6 changed files with 93 additions and 33 deletions
+26 -18
View File
@@ -431,11 +431,11 @@ export const downloadAllProgressFiles = async (
containerName,
progressBlobObj
) => {
console.log(
"/////////////////////////\n downloading files: " +
JSON.stringify(progressBlobObj) +
"\n/////////////////////////\n"
);
// console.log(
// "/////////////////////////\n downloading files: " +
// JSON.stringify(progressBlobObj) +
// "\n/////////////////////////\n"
// );
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
@@ -449,7 +449,7 @@ export const downloadAllProgressFiles = async (
let blobCount = 0;
for (const prop in progressBlobObj) {
console.log(`Progress - ${prop}: ${progressBlobObj[prop].path}`);
//console.log(`Progress - ${prop}: ${progressBlobObj[prop].path}`);
blobClient = containerClient.getBlobClient(progressBlobObj[prop].path);
downloadedBlob = await blobClient.download(0);
downloaded =
@@ -462,7 +462,7 @@ export const downloadAllProgressFiles = async (
downloaded = downloaded.substring(0, downloaded.length - 1);
for (const prop in progressBlobObj) {
console.log(`Cases - ${prop}: ${progressBlobObj[prop].caseObj}`);
//console.log(`Cases - ${prop}: ${progressBlobObj[prop].caseObj}`);
blobClient = containerClient.getBlobClient(
progressBlobObj[prop].caseObj
);
@@ -487,11 +487,11 @@ export const downloadAllProgressFiles = async (
};
export const downloadAllRepsFiles = async (containerName, repsBlobObj) => {
console.log(
"/////////////////////////\n downloading files: " +
JSON.stringify(repsBlobObj) +
"\n/////////////////////////\n"
);
// console.log(
// "/////////////////////////\n downloading files: " +
// JSON.stringify(repsBlobObj) +
// "\n/////////////////////////\n"
// );
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
@@ -506,7 +506,7 @@ export const downloadAllRepsFiles = async (containerName, repsBlobObj) => {
let blobCount = 0;
for (const prop in repsBlobObj) {
console.log(`Progress - ${prop}: ${repsBlobObj[prop].name}`);
//console.log(`Progress - ${prop}: ${repsBlobObj[prop].name}`);
blobClient = containerClient.getBlobClient(repsBlobObj[prop].name);
downloadedBlob = await blobClient.download(0);
let repBlobObj = await streamToBuffer(
@@ -578,13 +578,17 @@ export const getProgressBlobs = async (containerName, caseReference) => {
blobCount++;
}
console.log("this is the caasefolder:", caseReference, blobCount);
console.log(
"this is the casefolder and blobcount:",
caseReference,
blobCount
);
let blobObj = [];
for await (const blob of containerClient.listBlobsFlat({
prefix: caseReference + "/" + caseReference + "_appeal.json",
})) {
console.log("in here");
console.log("getProgressBlobs in here");
blobObj.push({
"name": blob.name.split("/")[1],
"path": blob.name,
@@ -676,14 +680,18 @@ export const getRepslobs = async (containerName, caseReference) => {
blobCount++;
}
console.log("this is the caasefolder:", caseReference, blobCount);
console.log(
"this is the casefolder and blobcount:",
caseReference,
blobCount
);
let blobObj = [];
for await (const blob of containerClient.findBlobsByTags(
"blobType='Representation'"
)) {
console.log("in here");
console.log(blob);
// console.log("getRepslobs in here");
// console.log(blob);
blobObj.push(blob);
}
+59 -7
View File
@@ -770,11 +770,11 @@ export const getAwaitingSubmission = (loggedInUserId) => {
};
export const getAwaitingSubmissionFromBlob = (containerName) => {
console.log(
"///////////////////////\ngetAwaitingSubmissionFromBlob: " +
containerName +
"\n///////////////////////\n"
);
// console.log(
// "///////////////////////\ngetAwaitingSubmissionFromBlob: " +
// containerName +
// "\n///////////////////////\n"
// );
return axios
.get(
BASE_URL +
@@ -821,7 +821,7 @@ export const getAwaitingSubmissionFromBlobProxy = (containerName) => {
BASE_URL +
"/api/file/getawaitingsubmissionfromblob?container=" +
containerName +
+hashAPIPath(
hashAPIPath(
"/api/file/getawaitingsubmissionfromblob?container=" +
containerName
)
@@ -999,7 +999,17 @@ export const createNewCaseBlob = (
"&contactid=" +
contactid +
"&containername=" +
containerName;
containerName +
hashAPIPath(
"/api/file/createcase_api?appealTypeId=" +
appealTypeId +
"&lpaID=" +
lpaID +
"&contactid=" +
contactid +
"&containername=" +
containerName
);
var config = {
method: "post",
@@ -1497,6 +1507,22 @@ export const getPortalLogin = (emailAddress) => {
});
};
export const createContainerProxy = (containerName) => {
var queryUrl =
"/api/file/setupcontainer?ident=" +
containerName +
hashAPIPath("/api/file/setupcontainer?ident=" + containerName);
return axios
.get(BASE_URL + queryUrl)
.then((res) => res.data)
.catch((error) => {
//console.log(consoleLogger(error));
console.log("thiserror", error);
return JSON.stringify(error);
});
};
export const sendCaseCompleteMessage = async (containerID, caseReference) => {
var queryUrl =
"/api/file/createappealcompletemessage_api?container=" +
@@ -1520,6 +1546,32 @@ export const sendCaseCompleteMessage = async (containerID, caseReference) => {
});
};
export const sendCaseCompleteMessageProxy = async (
containerID,
caseReference
) => {
var queryUrl =
"/api/file/createappealcompletemessageproxy_api?container=" +
containerID +
"&tempcaseref=" +
caseReference;
var config = {
method: "get",
url: queryUrl,
};
//console.log(data);
return axios(config)
.then((res) => {
return res.data;
})
.catch((error) => {
//console.log("API call error", error);
});
};
export const sendRepCompleteMessage = async (containerID, caseReference) => {
var queryUrl =
"/api/file/createrepcompletemessage_api?container=" +
+1 -1
View File
@@ -38,7 +38,7 @@ export default async function ApiProxy(req, res) {
azureHeadersPaged(token.access_token)
)
.then(({ data }) => {
console.log(data);
//console.log(data);
res.status(200).json(data);
})
.catch((err) => {
@@ -17,11 +17,11 @@ ApiProxy.get(async (req, res) => {
var checkquerypath =
"/api/file/getawaitingsubmissionfromblob?container=" + containerName;
console.log(
"///////////////////////\ngetawaitingsubmissionblob url :",
req.url,
"\n///////////////////////\n"
);
// console.log(
// "///////////////////////\ngetawaitingsubmissionblob url :",
// req.url,
// "\n///////////////////////\n"
// );
// console.log(hashAPIPath(checkquerypath), checkHash);
//console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
+1 -1
View File
@@ -223,7 +223,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
let loggedInUser = cookies.pinsUser;
let thisSession = await getSession(ctx);
console.log("nextAuth Session:", thisSession);
//console.log("nextAuth Session:", thisSession);
let loggedInUserIdent = thisSession.user.id;
let loggedInUserEmail = thisSession.user.email;
+1 -1
View File
@@ -139,7 +139,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
console.log("/newappeal - cookies ", cookies);
let thisSession = await getSession(ctx);
console.log("nextAuth Session:", thisSession);
//console.log("nextAuth Session:", thisSession);
if (_.has(thisSession, "user") == false) {
return {