16986 fixed unsubscribe all

This commit is contained in:
2025-06-03 05:45:23 +01:00
parent 297a5dfc77
commit c38da6c8d8
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) => {
+25 -16
View File
@@ -40,22 +40,29 @@ 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>
<ul>
{casesArr.map((key, index) => (
<li key={index}>
<strong>
{
key[
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]
}
</strong>
</li>
))}
</ul>
{casesArr != null && (
<ul>
{casesArr.map((key, index) => (
<li key={index}>
<strong>
{
key[
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]
}
</strong>
</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);