Skip to content

Commit

Permalink
fix: remove "Occasional Updates" toggle from profile page (#2394)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanason authored Dec 21, 2023
1 parent ab9a514 commit cc2eaa0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 87 deletions.
75 changes: 0 additions & 75 deletions packages/client/src/components/EmailSettingsBanner.vue

This file was deleted.

3 changes: 1 addition & 2 deletions packages/client/src/components/Modals/ProfileSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default {
methods: {
...mapActions({
changeSelectedAgency: 'users/changeSelectedAgency',
updateEmailSubscriptionPreferences: 'users/updateEmailSubscriptionPreferences',
updateEmailSubscriptionPreferences: 'users/updateEmailSubscriptionPreferencesForLoggedInUser',
}),
resetModal() {
this.$emit('update:showModal', false);
Expand All @@ -103,7 +103,6 @@ export default {
};
data.forEach((notificationType) => { updatedPreferences[notificationType] = 'SUBSCRIBED'; });
this.updateEmailSubscriptionPreferences({
userId: this.loggedInUser.id,
preferences: updatedPreferences,
});
},
Expand Down
5 changes: 2 additions & 3 deletions packages/client/src/store/modules/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,14 @@ export default {
}
await dispatch('fetchUsers');
},
async updateEmailSubscriptionPreferences({ dispatch, commit }, { userId, preferences }) {
async updateEmailSubscriptionPreferencesForLoggedInUser({ commit, getters }, { preferences }) {
const data = await fetchApi.put(
`/api/organizations/:organizationId/users/${userId}/email_subscription`,
`/api/organizations/:organizationId/users/${getters.loggedInUser.id}/email_subscription`,
{
preferences,
},
);
commit('SET_LOGGED_IN_USER', data.user);
dispatch('fetchUsers');
},
},
mutations: {
Expand Down
8 changes: 1 addition & 7 deletions packages/client/src/views/MyProfile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ export default {
key: 'GRANT_ASSIGNMENT',
description: 'Send me notifications if a grant has been assigned to my USDR Grants team.',
},
{
name: 'Occasional Updates',
key: 'GRANT_FINDER_UPDATES',
description: 'Send me occasional emails about feature releases, surveys, and other updates.',
},
],
breadcrumb_items: [
{
Expand Down Expand Up @@ -98,15 +93,14 @@ export default {
},
methods: {
...mapActions({
updateEmailSubscriptionPreferences: 'users/updateEmailSubscriptionPreferences',
updateEmailSubscriptionPreferences: 'users/updateEmailSubscriptionPreferencesForLoggedInUser',
}),
onUpdateEmailPreference(pref) {
const updatedPreferences = {
...this.emailPreferences,
[pref.key]: pref.checked ? 'SUBSCRIBED' : 'UNSUBSCRIBED',
};
this.updateEmailSubscriptionPreferences({
userId: this.loggedInUser.id,
preferences: updatedPreferences,
});
},
Expand Down

0 comments on commit cc2eaa0

Please sign in to comment.