diff --git a/src/notification-preferences/NotificationPreferenceApp.jsx b/src/notification-preferences/NotificationPreferenceApp.jsx index 1ab67b030..e7c0da546 100644 --- a/src/notification-preferences/NotificationPreferenceApp.jsx +++ b/src/notification-preferences/NotificationPreferenceApp.jsx @@ -14,7 +14,7 @@ import { selectUpdatePreferencesStatus, } from './data/selectors'; import NotificationPreferenceRow from './NotificationPreferenceRow'; -import { updateAppPreferenceToggle, updateChannelPreferenceToggle } from './data/thunks'; +import { updatePreferenceToggle } from './data/thunks'; import { LOADING_STATUS } from '../constants'; import NOTIFICATION_CHANNELS from './data/constants'; @@ -35,7 +35,7 @@ const NotificationPreferenceApp = ({ appId }) => { (preference) => preference[notificationChannel] && !isPreferenceNonEditable(preference), ); - dispatch(updateChannelPreferenceToggle(courseId, appId, notificationChannel, !hasActivePreferences)); + dispatch(updatePreferenceToggle(courseId, appId, notificationChannel, !hasActivePreferences)); }, [appId, appPreferences, courseId, dispatch, nonEditable]); const preferences = useMemo(() => ( diff --git a/src/notification-preferences/data/thunks.js b/src/notification-preferences/data/thunks.js index 222201b52..641bd6b50 100644 --- a/src/notification-preferences/data/thunks.js +++ b/src/notification-preferences/data/thunks.js @@ -149,15 +149,3 @@ export const updatePreferenceToggle = ( } } ); - -export const updateChannelPreferenceToggle = (courseId, notificationApp, notificationChannel, value) => ( - async (dispatch) => { - try { - const data = await patchChannelPreferenceToggle(courseId, notificationApp, notificationChannel, value); - const normalizedData = normalizePreferences(camelCaseObject(data)); - dispatch(fetchNotificationPreferenceSuccess(courseId, normalizedData)); - } catch (errors) { - dispatch(fetchNotificationPreferenceFailed()); - } - } -);