update appeal pdf file name

This commit is contained in:
2024-05-16 12:40:28 +01:00
parent 5a8e1e8d5b
commit 20a15d424f
2 changed files with 19 additions and 3 deletions
+9 -1
View File
@@ -319,8 +319,16 @@ export const createAppealPDFBlob = async (
const content = formContent;
const repDate = new Date();
let day = repDate.getDate();
let month = repDate.getMonth() + 1;
let year = repDate.getFullYear();
const pdfFileName = year + "-" + month + "-" + day + "_-_Appeal_Form";
//console.log(content);
const blobName = caseID + "/files/" + caseID + ".pdf";
const blobName = caseID + "/files/" + pdfFileName + ".pdf";
console.log("blobName:", blobName);
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
+10 -2
View File
@@ -180,6 +180,14 @@ export default async function handler(req, res) {
<MyDocument docProps={blobProgress} pickListData={pickListData} />
);
const repDate = new Date();
let day = repDate.getDate();
let month = repDate.getMonth() + 1;
let year = repDate.getFullYear();
const pdfFileName = year + "-" + month + "-" + day + "_-_Appeal_Form";
await createAppealPDFBlob(
renderedPDF,
containerID,
@@ -187,13 +195,13 @@ export default async function handler(req, res) {
).then((data) => {
console.log(
"///////////////////////////////////\nfile created: " +
`/files/${blobProgress.pinswg_name}.pdf`,
`/files/${pdfFileName}.pdf`,
"\n/////////////////////////"
);
return res.status(200).json({
status: "success",
data: data,
path: `/files/${blobProgress.pinswg_name}.pdf`,
path: `/files/${pdfFileName}.pdf`,
});
});
}