new appeals change involvment to appellant

This commit is contained in:
2024-11-29 13:11:26 +00:00
parent 202aa3cdb6
commit 0f8fc932e7
3 changed files with 43 additions and 10 deletions
+6 -2
View File
@@ -1081,8 +1081,11 @@ export const updatePassword = (contactId, newpassword) => {
});
};
export const updateAccount = async (contactId, updateBody) => {
var queryUrl = "/api/endpoint/updateaccount_api?contactId=" + contactId;
export const updateAccount = async (contactId, updateBody, ssr) => {
var queryUrl =
(ssr ? BASE_URL : "") +
"/api/endpoint/updateaccount_api?contactId=" +
contactId;
var data = updateBody;
var config = {
method: "post",
@@ -1095,6 +1098,7 @@ export const updateAccount = async (contactId, updateBody) => {
})
.catch((error) => {
//console.log("this error:", error);
consoleLogger(error);
});
};
+1 -1
View File
@@ -283,7 +283,7 @@ const TopThree = (props) => {
<div>
{showTopThreeArr[key].pinswg_appellantagent !=
846040000 && (
<b>{t("myportal:raised-by-label")}</b>
<b>{t("myportal:raised-by-label")}: </b>
)}
{showTopThreeArr[key].pinswg_appellantagent !=
846040000 &&
@@ -1,9 +1,10 @@
import { hashAPIPath } from "../../../actions";
import { hashAPIPath, updateAccount } from "../../../actions";
import {
createCaseCompleteMessage,
getProgressBlobs,
downloadProgressFile,
createBlob,
getCaseBlob,
} from "../../../actions/azurestorage";
import nextConnect from "next-connect";
@@ -34,9 +35,15 @@ ApiProxy.get(async (req, res) => {
return downloadProgressFile(containerName, data.path, tempCaseRef);
});
Object.assign(blobProgress, {
"appealComplete": tempCaseRef,
});
const caseObj = await downloadProgressFile(
containerName,
tempCaseRef + "/" + tempCaseRef + "_case.json",
tempCaseRef
);
// Object.assign(blobProgress, {
// "appealComplete": tempCaseRef,
// });
delete blobProgress["pinswg_name"];
@@ -44,9 +51,31 @@ ApiProxy.get(async (req, res) => {
await createBlob(JSON.stringify(blobProgress), containerName, tempCaseRef)
.then(() => {
createCaseCompleteMessage(containerName, tempCaseRef);
return res.status(200).json({
status: "success",
//update case.json with lpa ref and description
Object.assign(caseObj, {
"pinswg_lpareference":
blobProgress.pinswg_lpaapplicationreference,
"description": blobProgress.pinswg_developmentdescription,
});
//send update case.json and then create queue message
getCaseBlob(containerName, tempCaseRef, caseObj).then(() => {
let contactId = caseObj["customerid_contact@odata.bind"];
contactId = contactId.match(/\(([^)]+)\)/);
updateAccount(
contactId[1],
{
"pinswg_typeofinvolvement": 846040001,
},
true
).then((data) => {
console.log("uopdated account: ", data);
});
createCaseCompleteMessage(containerName, tempCaseRef);
return res.status(200).json({
status: "success",
});
});
})
.catch((error) => {