console log tidying

This commit is contained in:
2024-06-05 19:50:56 +01:00
parent 3284bce649
commit 2a6cd32452
44 changed files with 290 additions and 466 deletions
+1 -1
View File
@@ -163,7 +163,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
let thisSession = await getSession(ctx);
// console.log(
//console.log(
// "auth sess for register :",
// thisSession,
// thisSession.user.email
+2 -2
View File
@@ -126,8 +126,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
await getLPA(),
]);
// const lpaData = require("../data/lpa.json");
// const appealTypeData = require("../data/appealtypes.json");
//const lpaData = require("../data/lpa.json");
//const appealTypeData = require("../data/appealtypes.json");
store.dispatch(setAppealType(appealTypeData));
store.dispatch(setLPA(lpaData));
@@ -431,7 +431,7 @@ export default async function ApiProxy(req, res) {
item.NavigationProperty.toLowerCase() +
"_value";
// console.log(
//console.log(
// "\n==========================================\n",
// "basic search: " + queryUrl,
// "\n\n",
@@ -458,7 +458,7 @@ export default async function ApiProxy(req, res) {
item.NavigationProperty.toLowerCase() +
"_value";
// console.log(
//console.log(
// "\n==========================================\n",
// "basic search: " + queryUrl,
// "\n\n",
+7 -7
View File
@@ -50,13 +50,13 @@ export default async function ApiProxy(req, res) {
const lpaGUID = jsonpath('$..[?(@.name=="' + lpaid + '")]', lpaList);
console.log(
'$..[?(@.name="' + lpaid + '")]',
lpaList,
lpaid,
"LPAGUID=",
lpaGUID
);
//console.log(
// '$..[?(@.name="' + lpaid + '")]',
// lpaList,
// lpaid,
// "LPAGUID=",
// lpaGUID
// );
var queryUrl =
"incidents?$select=modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_pinswg_associatedlpa_value eq " +
+1 -1
View File
@@ -45,7 +45,7 @@ export default async function ApiProxy(req, res) {
contactid +
")?$select=firstname, lastname, emailaddress1, telephone1, company, address1_line1,address1_line2,address1_city, address1_county,address1_postalcode,pinswg_typeofinvolvement,pinswg_contact_associatedlpa,pinswg_preferredlanguage&$count=true";
// console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
//console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
var apiResponse =
contactid.length > 0
@@ -19,8 +19,8 @@ ApiProxy.get(async (req, res) => {
console.log("/////Create Case Message:\n", tempCaseRef, "\n//////////////");
// console.log(hashAPIPath(checkquerypath), checkHash);
// console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
//console.log(hashAPIPath(checkquerypath), checkHash);
//console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
var checkquerypath =
"/api/file/createappealcompletemessage_api?container=" +
containerName +
@@ -22,8 +22,8 @@ ApiProxy.get(async (req, res) => {
console.log("/////Create Case Message:\n", tempCaseRef, "\n//////////////");
// console.log(hashAPIPath(checkquerypath), checkHash);
// console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
//console.log(hashAPIPath(checkquerypath), checkHash);
//console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
var token = await getToken();
@@ -15,8 +15,8 @@ ApiProxy.get(async (req, res) => {
var tempCaseRef = req.query.tempcaseref;
var filename = req.query.repid;
// 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 createRepCompleteMessage(containerName, tempCaseRef, filename).then(
@@ -21,8 +21,8 @@ ApiProxy.get(async (req, res) => {
"&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(
+2 -2
View File
@@ -21,8 +21,8 @@ ApiProxy.get(async (req, res) => {
"&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(
+2 -2
View File
@@ -19,8 +19,8 @@ ApiProxy.get(async (req, res) => {
"&casefolderID=" +
casefolderID;
// 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 deleteBlobCase(containerName, casefolderID).then((data) => {
+2 -2
View File
@@ -24,8 +24,8 @@ ApiProxy.get(async (req, res) => {
casefolderID = casefolderID + "/" + repfile;
// 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 deleteBlobRep(containerName, casefolderID).then((data) => {
+1 -1
View File
@@ -105,7 +105,7 @@ import { statement_pdf } from "../../../components/pdftemplates/statement_pdf";
import { writtenStatement_pdf } from "../../../components/pdftemplates/writtenStatement_pdf";
import { other_pdf } from "../../../components/pdftemplates/other_pdf";
// const ApiProxy = nextConnect();
//const ApiProxy = nextConnect();
// ApiProxy.use(middleware);
// ApiProxy.post(async (req, res) => {
+3 -3
View File
@@ -100,7 +100,7 @@ import { statement_pdf } from "../../../components/pdftemplates/statement_pdf";
import { writtenStatement_pdf } from "../../../components/pdftemplates/writtenStatement_pdf";
import { other_pdf } from "../../../components/pdftemplates/other_pdf";
import { consoleLogger } from "../../../actions";
// const ApiProxy = nextConnect();
//const ApiProxy = nextConnect();
// ApiProxy.use(middleware);
// ApiProxy.post(async (req, res) => {
@@ -131,7 +131,7 @@ export default async function handler(req, res) {
var checkquerypath = "/api/file/generatepdf";
//console.log("-------", checkHash);
// console.log(hashAPIPath(checkquerypath) == "?hash=" + checkHash);
//console.log(hashAPIPath(checkquerypath) == "?hash=" + checkHash);
//console.log(casefolderID, caseRef);
// Create Document Component
@@ -215,7 +215,7 @@ export default async function handler(req, res) {
// code block
}
// console.log(
//console.log(
// "///////////////////////////////////\n file created: \n" +
// process.cwd() +
// `tmp/${reqBodyobj.repfile_name}.pdf` +
@@ -17,12 +17,12 @@ ApiProxy.get(async (req, res) => {
var checkquerypath =
"/api/file/getawaitingsubmissionfromblob?container=" + containerName;
console.log(
"///////////////////////\ngetawaitingsubmissionblob url :",
req.url,
"\n///////////////////////\n"
);
// console.log(hashAPIPath(checkquerypath), checkHash);
// console.log(
// "///////////////////////\ngetawaitingsubmissionblob url :",
// req.url,
// "\n///////////////////////\n"
// );
//console.log(hashAPIPath(checkquerypath), checkHash);
//console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
+2 -2
View File
@@ -49,8 +49,8 @@ ApiProxy.get(async (req, res) => {
"&casefolderID=" +
casefolderID;
// 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 getBlobs(containerName, casefolderID).then((data) => {
+1 -1
View File
@@ -22,7 +22,7 @@ ApiProxy.get(async (req, res) => {
casefolderID;
//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 getProgressBlobs(containerName, casefolderID)
+16 -16
View File
@@ -48,24 +48,24 @@ ApiProxy.get(async (req, res) => {
var checkHash = req.query.hash;
var checkquerypath = "/api/file/getrepsblob?container=" + containerName;
// console.log("-----", casefolderID);
// console.log("-----", req.query);
// console.log("-----", checkquerypath);
// console.log("-----", hashAPIPath(checkquerypath));
// console.log("-----", checkHash);
// console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
//console.log("-----", casefolderID);
//console.log("-----", req.query);
//console.log("-----", checkquerypath);
//console.log("-----", hashAPIPath(checkquerypath));
//console.log("-----", checkHash);
//console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
const blobObj = await getRepsBlobs(containerName, casefolderID)
.then(async (data) => {
console.log(
"\n////////////////////////////\n getRepsBlobs:",
data
);
//console.log(
// "\n////////////////////////////\n getRepsBlobs:",
// data
// );
return data;
})
.then(async (data) => {
console.log("\n////////////////////////////\n now here:", data);
//console.log("\n////////////////////////////\n now here:", data);
let result = await downloadAllRepsFiles(containerName, data);
@@ -75,11 +75,11 @@ ApiProxy.get(async (req, res) => {
.json(result);
})
.catch((error) => {
console.log(
"///////////////////////\ngetRepsFromBlob api in api route response: " +
error +
"\n///////////////////////\n"
);
//console.log(
// "///////////////////////\ngetRepsFromBlob api in api route response: " +
// error +
// "\n///////////////////////\n"
// );
//console.log("API call error", error);
console.log(consoleLogger(error));
+2 -2
View File
@@ -17,8 +17,8 @@ ApiProxy.get(async (req, res) => {
var checkHash = req.query.hash;
var checkquerypath = "/api/file/setupcontainer?ident=" + containerName;
// console.log(checkquerypath, hashAPIPath(checkquerypath), checkHash);
// console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
//console.log(checkquerypath, hashAPIPath(checkquerypath), checkHash);
//console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
await createContainer(containerName)
+5 -5
View File
@@ -12,9 +12,9 @@ ApiProxy.use(middleware);
ApiProxy.post(async (req, res) => {
var checkHash = req.query.hash;
// console.log(JSON.stringify(req.body));
// console.log(JSON.stringify(req.body.appealData));
// console.log(req.files);
//console.log(JSON.stringify(req.body));
//console.log(JSON.stringify(req.body.appealData));
//console.log(req.files);
const appealData = req.body.appealData;
const containerID = req.body.containerID[0];
@@ -25,8 +25,8 @@ ApiProxy.post(async (req, res) => {
// var checkquerypath = "/api/file/upload";
// 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) {
//createContainer(containerID).then((containerName) => {
+11 -11
View File
@@ -143,16 +143,16 @@ export const getServerSideProps = wrapper.getServerSideProps(
const searchResultsObj = await getBasicSearch(developmentQuery);
const searchDetailsObj = await getSearchDetails(searchResultsObj);
console.log(
"\n======================================\n",
searchResultsObj,
"\n======================================\n"
);
console.log(
"\n======================================\n",
searchDetailsObj[0],
"\n======================================\n"
);
//console.log(
// "\n======================================\n",
// searchResultsObj,
// "\n======================================\n"
// );
//console.log(
// "\n======================================\n",
// searchDetailsObj[0],
// "\n======================================\n"
// );
store.dispatch(setSearch(developmentQuery));
@@ -203,7 +203,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
);
}
}
// console.log(searchResultsObj);
//console.log(searchResultsObj);
return {
props: {
// searchResultsObj: {
+2 -2
View File
@@ -136,12 +136,12 @@ export const getServerSideProps = wrapper.getServerSideProps(
const searchResultsObj = await getIncidentbyID(query.incident);
const searchDetailsObj = await getSearchDetails(searchResultsObj);
// console.log(
//console.log(
// "\n======================================\n",
// searchResultsObj,
// "\n======================================\n"
// );
// console.log(
//console.log(
// "\n======================================\n",
// searchDetailsObj[0],
// "\n======================================\n"
+2 -2
View File
@@ -147,7 +147,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(setSearch(developmentQuery));
// console.log({
//console.log({
// "currentReference": searchResultsObj.value[0].title,
// "currentType": "searchResultsObj",
// "incidentid": searchResultsObj.value[0].incidentid,
@@ -187,7 +187,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
);
}
}
// console.log(searchResultsObj);
//console.log(searchResultsObj);
return {
props: {
searchResultsObj: {
+1 -1
View File
@@ -56,7 +56,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
(store) =>
async ({ query, req, res }) => {
console.log("query-", query);
// const searchResultsObj = (await getBasicSearch(query.q)) || null;
//const searchResultsObj = (await getBasicSearch(query.q)) || null;
// store.dispatch(setSearchResults(searchResultsObj));
//store.dispatch(setSearch(query.q));
}
+1 -1
View File
@@ -53,7 +53,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
(store) =>
async ({ query, req, res }) => {
console.log("query-", query);
// const searchResultsObj = (await getBasicSearch(query.q)) || null;
//const searchResultsObj = (await getBasicSearch(query.q)) || null;
// store.dispatch(setSearchResults(searchResultsObj));
//store.dispatch(setSearch(query.q));
}
+1 -1
View File
@@ -87,7 +87,7 @@ let Home = (props) => {
//let optionsTitleObj = [];
// const optionsTitleObj = selectedObj.reduce(
//const optionsTitleObj = selectedObj.reduce(
// (obj, arrValue) => (
// (obj[arrValue] = arrValue
// .replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
+2 -2
View File
@@ -99,8 +99,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
]
);
// const lpaData = require("../../data/lpa.json");
// const appealTypeData = require("../../data/appealtypes.json");
//const lpaData = require("../../data/lpa.json");
//const appealTypeData = require("../../data/appealtypes.json");
store.dispatch(setAccountDetails(accountDetails));
store.dispatch(setAppealType(appealTypeData));
+14 -14
View File
@@ -160,16 +160,16 @@ export const getServerSideProps = wrapper.getServerSideProps(
const searchResultsObj = await getBasicSearch(developmentQuery);
const searchDetailsObj = await getSearchDetails(searchResultsObj);
console.log(
"\n======================================\n",
searchResultsObj,
"\n======================================\n"
);
console.log(
"\n======================================\n",
searchDetailsObj[0],
"\n======================================\n"
);
//console.log(
// "\n======================================\n",
// searchResultsObj,
// "\n======================================\n"
// );
//console.log(
// "\n======================================\n",
// searchDetailsObj[0],
// "\n======================================\n"
// );
store.dispatch(setSearch(developmentQuery));
@@ -324,9 +324,9 @@ export const getServerSideProps = wrapper.getServerSideProps(
);
}
}
// console.log(searchResultsObj);
//console.log(searchResultsObj);
console.log(loggedInUser);
//console.log(loggedInUser);
return {
props: {
// searchResultsObj: {
@@ -341,7 +341,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
const getDetails = (resultsObj, detailsType) => {
let detailsArr = [];
// console.log(
//console.log(
// "//////////////////////////////////\n",
// resultsObj,
// //"\n",
@@ -352,7 +352,7 @@ const getDetails = (resultsObj, detailsType) => {
resultsObj =
detailsType == "mySubmittedReps" ? resultsObj : resultsObj.value;
// console.log(
//console.log(
// "////////////////////////////////// resultsobj\n",
// detailsType,
// "\n",
+3 -3
View File
@@ -133,12 +133,12 @@ export const getServerSideProps = wrapper.getServerSideProps(
const searchResultsObj = await getIncidentbyID(query.incident);
const searchDetailsObj = await getSearchDetails(searchResultsObj);
// console.log(
//console.log(
// "\n======================================\n",
// searchResultsObj,
// "\n======================================\n"
// );
// console.log(
//console.log(
// "\n======================================\n",
// searchDetailsObj[0],
// "\n======================================\n"
@@ -175,7 +175,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
);
}
}
// console.log(searchResultsObj);
//console.log(searchResultsObj);
return {
props: {
searchResultsObj: {
+3 -3
View File
@@ -223,7 +223,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
await getAwaitingSubmissionFromBlob(thisSession.user.id),
]);
// console.log(
//console.log(
// "/////////////////////////\n ",
// awaitingSubmissionFromBlob.value,
// awaitingSubmissionFromBlob.case
@@ -346,7 +346,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
const getDetails = (resultsObj, detailsType) => {
let detailsArr = [];
// console.log(
//console.log(
// "//////////////////////////////////\n",
// resultsObj,
// //"\n",
@@ -357,7 +357,7 @@ const getDetails = (resultsObj, detailsType) => {
resultsObj =
detailsType == "mySubmittedReps" ? resultsObj : resultsObj.value;
// console.log(
//console.log(
// "////////////////////////////////// resultsobj\n",
// detailsType,
// "\n",
+1 -1
View File
@@ -77,7 +77,7 @@ let Home = (props) => {
//let optionsTitleObj = [];
// const optionsTitleObj = selectedObj.reduce(
//const optionsTitleObj = selectedObj.reduce(
// (obj, arrValue) => (
// (obj[arrValue] = arrValue
// .replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
+2 -2
View File
@@ -183,8 +183,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
"\n////////////////////////////\n"
);
// const lpaData = require("../../data/lpa.json");
// const appealTypeData = require("../../data/appealtypes.json");
//const lpaData = require("../../data/lpa.json");
//const appealTypeData = require("../../data/appealtypes.json");
store.dispatch(setAppealType(appealTypeData));
store.dispatch(setLPA(lpaData));
+5 -5
View File
@@ -13,7 +13,7 @@ import { getIP } from "../actions";
const ShowStorage = (props) => {
const { container } = props;
// console.log("Containers:");
//console.log("Containers:");
// // for await (const container of blobServiceClient.listContainers()) {
// // console.log(`- ${container.name}`);
// // }
@@ -49,8 +49,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
creds
);
// const createContainerResponse = await containerClient.create();
// console.log(
//const createContainerResponse = await containerClient.create();
//console.log(
// `Created container ${containerName} successfully`,
// createContainerResponse.requestId
// );
@@ -72,7 +72,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
// const blockBlobClient =
// containerClient.getBlockBlobClient(blobName);
// // const uploadBlobResponse = await blockBlobClient.upload(
// //const uploadBlobResponse = await blockBlobClient.upload(
// // content,
// // Buffer.byteLength(content),
// // uploadOptions
@@ -90,7 +90,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
// //console.log(tags);
// //await blockBlobClient.setTags(tags);
// // console.log(
// //console.log(
// // `Uploaded block blob ${blobName} successfully`,
// // uploadBlobResponse.requestId
// // );