create rep pdf tweaks prior to multi types matrix

This commit is contained in:
2023-10-11 13:51:35 +01:00
parent 1f669a5efe
commit f53faf47e2
10 changed files with 1824 additions and 799 deletions
+2 -25
View File
@@ -207,38 +207,18 @@ export default function handler(req, res) {
// code block
}
// const repDate = new Date();
// let day = ("0" + repDate.getDate()).slice(-2);
// let month = ("0" + (repDate.getMonth() + 1)).slice(-2);
// let year = repDate.getFullYear();
// let time =
// ("0" + repDate.getHours()).slice(-2) +
// "" +
// ("0" + repDate.getMinutes()).slice(-2);
// let repDateStamp = "";
// repDateStamp = year + "" + month + day; //+ "-" + time;
//console.log(reqBodyobj);
//if (hashAPIPath(checkquerypath) == "?hash=" + checkHash) {
// //createContainer(containerID).then((containerName) => {
// console.log("does this get folder name:", containerID, casefolderID);
console.log(
"///////////////////////////////////\n file created: \n" +
`tmp/${reqBodyobj.repfile_name}.pdf` +
"\n/////////////////////////"
);
// createRepBlob(req.body, containerID, caseRef);
ReactPDF.render(
<MyDocument docProps={reqBodyobj} />,
`tmp/${reqBodyobj.repfile_name}.pdf`
);
// upload file to storage account
uploadPDFRepFiles(
`tmp/${reqBodyobj.repfile_name}.pdf`,
containerID,
@@ -246,10 +226,7 @@ export default function handler(req, res) {
repType
);
// to do upload file to storage account
// then remove from local folder
// remove from local folder
// fs.unlinkSync( `tmp/${reqBodyobj.repfile_name}.pdf`,);
return res.status(200).json({