Merged PR 1652: 16986 fixed unsubscribe all

16986 fixed unsubscribe all

Related work items: #16986
This commit is contained in:
Robert Bond
2025-06-03 04:46:17 +00:00
2 changed files with 26 additions and 17 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ const deleteWatchedCases = async (watchedCaseID) => {
return axios(config)
.then(({ data }) => {
//console.log("deleted watched case - " + watchedCaseID);
console.log("deleted watched case - " + watchedCaseID);
res.status(200).json(data);
})
.catch((error) => {
+12 -3
View File
@@ -40,9 +40,15 @@ const UnsubscribeCase = (props) => {
<h1>{t("common:unsubscribe-case-title")}</h1>
<p>
{t("common:unsubscribe-case-all-label")}
{casesArr.length > 0 ? "s" : ""}
{casesArr == null
? t(
"common:unsubscribe-case-none-label"
)
: t(
"common:unsubscribe-case-all-label"
) + (casesArr.length > 0 ? "s" : "")}
</p>
{casesArr != null && (
<ul>
{casesArr.map((key, index) => (
<li key={index}>
@@ -56,6 +62,7 @@ const UnsubscribeCase = (props) => {
</li>
))}
</ul>
)}
<Link href="/">
{t("common:logged-out-link")}
@@ -154,8 +161,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
//hasUnsubscribed && (await deleteWatchedCases(query.watchlistid));
searchResultsObj.value.forEach(function (watchListID) {
searchResultsObj.value.forEach(async function (watchListID) {
console.log(watchListID.pinswg_watchlistid);
deleteWatchedCases(watchListID.pinswg_watchlistid);
});
//console.log(deleteCase);