adjusted ordering of sequence to complete

This commit is contained in:
2024-05-02 10:37:28 +01:00
parent eb08e67546
commit 0f3d20ca80
6 changed files with 67 additions and 31 deletions
+1
View File
@@ -1740,6 +1740,7 @@ export const sendCaseCompleteMessage = async (containerID, caseReference) => {
return axios(config) return axios(config)
.then((res) => { .then((res) => {
console.log("sendCaseCompleteMessage: ", res.data);
return res.data; return res.data;
}) })
.catch((error) => { .catch((error) => {
@@ -78,7 +78,7 @@ const AwaitingSubmissionFromBlob = (props) => {
<div className="cardModuleReference"> <div className="cardModuleReference">
<b>{t("myportal:temp-reference")}:</b> <b>{t("myportal:temp-reference")}:</b>
{showTopThreeArr[key].hasOwnProperty( {showTopThreeArr[key].hasOwnProperty(
"appealCompletes" "appealComplete"
) ? ( ) ? (
<b> <b>
{showTopThreeArr[index].pinswg_name} {showTopThreeArr[index].pinswg_name}
+25 -10
View File
@@ -18,7 +18,7 @@ import {
getThumbnailIconByExtension, getThumbnailIconByExtension,
bytesToSize, bytesToSize,
} from "../utils"; } from "../utils";
import { generateAppealPDF } from "../../actions"; import { generateAppealPDF, sendCaseCompleteMessage } from "../../actions";
let BuildCheckSection = (props) => { let BuildCheckSection = (props) => {
useEffect(() => { useEffect(() => {
@@ -118,6 +118,29 @@ let BuildCheckSection = (props) => {
return labelTrans; return labelTrans;
}; };
const finaliseAppeal = async () => {
console.log("finalising appeal:");
await generateAppealPDF(
pdfObj,
props.props.accountDetails.containerID,
props.appealType.caseReference.ticketnumber,
router.query.appealtypes,
pdfObj.filesList
// props.appealType.fileList
)
.then((data) => {
console.log("have generated pdf:", data);
sendCaseCompleteMessage(
props.props.accountDetails.containerID,
props.appealType.caseReference.ticketnumber
);
})
.then((data) => {
console.log("have sent comple message :", data);
setCurrentSection(9999);
});
};
return ( return (
<div className="govuk-grid-row" key={1222}> <div className="govuk-grid-row" key={1222}>
<div className="govuk-grid-column-full"> <div className="govuk-grid-column-full">
@@ -254,15 +277,7 @@ let BuildCheckSection = (props) => {
className="govuk-button" className="govuk-button"
data-module="govuk-button" data-module="govuk-button"
onClick={() => { onClick={() => {
generateAppealPDF( finaliseAppeal();
pdfObj,
props.props.accountDetails.containerID,
props.appealType.caseReference.ticketnumber,
router.query.appealtypes,
pdfObj.filesList
// props.appealType.fileList
),
setCurrentSection(9999);
}} }}
> >
{t("newappeal:submit-appeal-button")} {t("newappeal:submit-appeal-button")}
+4 -4
View File
@@ -62,10 +62,10 @@ let CompleteAppeal = (props) => {
}; };
sendEmail(templateId, emailAddress, personalisation, reference); sendEmail(templateId, emailAddress, personalisation, reference);
sendCaseCompleteMessage( // sendCaseCompleteMessage(
props.props.accountDetails.containerID, // props.props.accountDetails.containerID,
props.appealType.caseReference.ticketnumber // props.appealType.caseReference.ticketnumber
); // );
console.log("patching///////////////"); console.log("patching///////////////");
// //
@@ -27,28 +27,48 @@ ApiProxy.get(async (req, res) => {
"&tempcaseref=" + "&tempcaseref=" +
tempCaseRef; tempCaseRef;
// const blobProgress = await getProgressBlobs( const blobProgress = await getProgressBlobs(
// containerName, containerName,
// tempCaseRef tempCaseRef
// ).then((data) => { ).then((data) => {
// return downloadProgressFile(containerName, data.path, tempCaseRef); return downloadProgressFile(containerName, data.path, tempCaseRef);
// }); });
// Object.assign(blobProgress, { Object.assign(blobProgress, {
// "appealComplete": true, "appealComplete": true,
// }); });
//http: if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) { //http: if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
await createCaseCompleteMessage(containerName, tempCaseRef)
.then((data) => { await createBlob(JSON.stringify(blobProgress), containerName, tempCaseRef)
//createBlob(JSON.stringify(blobProgress), containerName, tempCaseRef); .then(() => {
createCaseCompleteMessage(containerName, tempCaseRef);
return res.status(200).json(data); return res.status(200).json(data);
}) })
.catch((error) => { .catch((error) => {
//console.log(error); console.log(
"///////////////////////\n createCaseCompleteMessage:",
error,
"///////////////////////\n"
);
return res.status(400).json(error); return res.status(400).json(error);
}); });
// await createCaseCompleteMessage(containerName, tempCaseRef)
// .then((data) => {
// console.log(data);
// createBlob(
// JSON.stringify(blobProgress),
// containerName,
// tempCaseRef
// );
// return res.status(200).json(data);
// })
// .catch((error) => {
// console.log(error);
// return res.status(400).json(error);
// });
}); });
export const config = { export const config = {
+2 -2
View File
@@ -186,8 +186,8 @@ export default async function handler(req, res) {
blobProgress.pinswg_name blobProgress.pinswg_name
).then((data) => { ).then((data) => {
console.log( console.log(
"///////////////////////////////////\nfile created: " + data, "///////////////////////////////////\nfile created: " +
`/files/${blobProgress.pinswg_name}.pdf`, `/files/${blobProgress.pinswg_name}.pdf`,
"\n/////////////////////////" "\n/////////////////////////"
); );
return res.status(200).json({ return res.status(200).json({