17025 unsub issues

This commit is contained in:
2025-06-10 11:25:32 +01:00
parent 5dee64dfec
commit 193da6af2f
9 changed files with 412 additions and 25 deletions
+58 -5
View File
@@ -187,6 +187,27 @@ const CaseSummary = (props) => {
.then((data) => data)
.then(() => {
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
let showWatchedCases = (submittedArr) => {
const required = submittedArr.value.filter((el) => {
return (
el.pinswg_representationsubmitted == null
);
});
let newObj = {};
return Object.assign(newObj, {
"@odata.count": required.length,
"value": required,
});
};
data = showWatchedCases(data);
data.value.sort(function compare(a, b) {
var dateA = new Date(a.createdon);
var dateB = new Date(b.createdon);
return dateB - dateA;
});
setWatchedCases(data),
getDetailsProxy(data, "myWatchedCases").then(
(data) => {
@@ -1266,12 +1287,44 @@ const CaseSummary = (props) => {
{t(
"case:watch-this-case-link"
)}
</button>{" "}
<button
className="govuk-link watchCase"
onClick={() => {
confirm(
t(
"case:summary-subscribe-mail-label"
) +
" " +
props
.currentView
.caseReference
.currentReference +
"?"
) &&
setCookie(
null,
"pedwWatchCase",
currentType ==
"searchResultsObj"
? detailsObj.pinswg_name
: currentType ==
"directResultsObj"
? casesObj.title
: casesObj.reference,
{
path: "/",
expires:
expDate,
}
),
signIn();
}}
>
{t(
"case:send-email-notifications"
)}
</button>
{/* <button
onClick={handleOpenModal}
>
Open Modal
</button> */}
</>
)}
</div>