16986 fixed unsubscribe all
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user