diff --git a/src/__snapshots__/index.test.jsx.snap b/src/__snapshots__/index.test.jsx.snap
index 7eb0886b..f0b7c6ca 100644
--- a/src/__snapshots__/index.test.jsx.snap
+++ b/src/__snapshots__/index.test.jsx.snap
@@ -68,7 +68,7 @@ exports[`app registry subscribe: APP_READY. links App to root element 1`] = `
}
- path="/preferences-unsubscribe/:userToken/:updatePatch"
+ path="/preferences-unsubscribe/:userToken/:updatePatch?"
/>
(
- `${getConfig().LMS_BASE_URL}/api/notifications/preferences/update/${userToken}/${updatePatch}/`
+export const getUnsubscribeUrl = (userToken) => (
+ `${getConfig().LMS_BASE_URL}/api/notifications/preferences/update/${userToken}/`
);
-export async function unsubscribeNotificationPreferences(userToken, updatePatch) {
- const url = getUnsubscribeUrl(userToken, updatePatch);
+export async function unsubscribeNotificationPreferences(userToken) {
+ const url = getUnsubscribeUrl(userToken);
return getAuthenticatedHttpClient().get(url);
}
diff --git a/src/preferences-unsubscribe/index.jsx b/src/preferences-unsubscribe/index.jsx
index a8667baa..0829e089 100644
--- a/src/preferences-unsubscribe/index.jsx
+++ b/src/preferences-unsubscribe/index.jsx
@@ -17,18 +17,18 @@ import messages from './messages';
const PreferencesUnsubscribe = () => {
const intl = useIntl();
- const { userToken, updatePatch } = useParams();
+ const { userToken } = useParams();
const [status, setStatus] = useState(LOADING);
useEffect(() => {
- unsubscribeNotificationPreferences(userToken, updatePatch).then(
+ unsubscribeNotificationPreferences(userToken).then(
() => setStatus(LOADED),
(error) => {
setStatus(FAILED);
logError(error);
},
);
- sendTrackEvent('edx.ui.lms.notifications.preferences.unsubscribe', { userToken, updatePatch });
+ sendTrackEvent('edx.ui.lms.notifications.preferences.unsubscribe', { userToken });
}, []);
const pageContent = {
diff --git a/src/preferences-unsubscribe/index.test.jsx b/src/preferences-unsubscribe/index.test.jsx
index 52cef01b..e1973e22 100644
--- a/src/preferences-unsubscribe/index.test.jsx
+++ b/src/preferences-unsubscribe/index.test.jsx
@@ -24,8 +24,7 @@ describe('Notification Preferences One Click Unsubscribe', () => {
let component;
let store;
const userToken = '1234';
- const updatePatch = 'abc123';
- const url = getUnsubscribeUrl(userToken, updatePatch);
+ const url = getUnsubscribeUrl(userToken);
beforeAll(async () => {
await initializeTestStore();
@@ -39,7 +38,7 @@ describe('Notification Preferences One Click Unsubscribe', () => {
component = (
-
+
} />
@@ -69,7 +68,6 @@ describe('Notification Preferences One Click Unsubscribe', () => {
expect(screen.getByTestId('heading-text')).toHaveTextContent('Error unsubscribing from preference');
expect(sendTrackEvent).toHaveBeenCalledWith('edx.ui.lms.notifications.preferences.unsubscribe', {
userToken,
- updatePatch,
});
});
});