Skip to content

Commit a47ea68

Browse files
feat: updated notification preferences unsubscribe flow
1 parent 0dfbca7 commit a47ea68

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const DECODE_ROUTES = {
2222

2323
export const ROUTES = {
2424
UNSUBSCRIBE: '/goal-unsubscribe/:token',
25-
PREFERENCES_UNSUBSCRIBE: '/preferences-unsubscribe/:userToken/:updatePatch',
25+
PREFERENCES_UNSUBSCRIBE: '/preferences-unsubscribe/:userToken/:updatePatch?',
2626
REDIRECT: '/redirect/*',
2727
DASHBOARD: 'dashboard',
2828
ENTERPRISE_LEARNER_DASHBOARD: 'enterprise-learner-dashboard',
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { getConfig } from '@edx/frontend-platform';
22
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
33

4-
export const getUnsubscribeUrl = (userToken, updatePatch) => (
5-
`${getConfig().LMS_BASE_URL}/api/notifications/preferences/update/${userToken}/${updatePatch}/`
4+
export const getUnsubscribeUrl = (userToken) => (
5+
`${getConfig().LMS_BASE_URL}/api/notifications/preferences/update/${userToken}/`
66
);
77

8-
export async function unsubscribeNotificationPreferences(userToken, updatePatch) {
9-
const url = getUnsubscribeUrl(userToken, updatePatch);
8+
export async function unsubscribeNotificationPreferences(userToken) {
9+
const url = getUnsubscribeUrl(userToken);
1010
return getAuthenticatedHttpClient().get(url);
1111
}

src/preferences-unsubscribe/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ import messages from './messages';
1717

1818
const PreferencesUnsubscribe = () => {
1919
const intl = useIntl();
20-
const { userToken, updatePatch } = useParams();
20+
const { userToken } = useParams();
2121
const [status, setStatus] = useState(LOADING);
2222

2323
useEffect(() => {
24-
unsubscribeNotificationPreferences(userToken, updatePatch).then(
24+
unsubscribeNotificationPreferences(userToken).then(
2525
() => setStatus(LOADED),
2626
(error) => {
2727
setStatus(FAILED);
2828
logError(error);
2929
},
3030
);
31-
sendTrackEvent('edx.ui.lms.notifications.preferences.unsubscribe', { userToken, updatePatch });
31+
sendTrackEvent('edx.ui.lms.notifications.preferences.unsubscribe', { userToken });
3232
}, []);
3333

3434
const pageContent = {

0 commit comments

Comments
 (0)