feat: Ability to remove user profile picture (#3156)

Fixes #3107
This commit is contained in:
Santhosh C
2021-11-27 00:56:07 +05:30
committed by GitHub
parent add004a56e
commit b326da7d94
9 changed files with 84 additions and 3 deletions

View File

@@ -121,6 +121,15 @@ export const actions = {
}
},
deleteAvatar: async ({ commit }) => {
try {
await authAPI.deleteAvatar();
commit(types.default.SET_CURRENT_USER);
} catch (error) {
// Ignore error
}
},
updateUISettings: async ({ commit }, params) => {
try {
commit(types.default.SET_CURRENT_USER_UI_SETTINGS, params);

View File

@@ -63,7 +63,7 @@ describe('#actions', () => {
});
await actions.updateAvailability(
{ commit, dispatch },
{ availability: 'offline', account_id: 1 },
{ availability: 'offline', account_id: 1 }
);
expect(setUser).toHaveBeenCalledTimes(1);
expect(commit.mock.calls).toEqual([[types.default.SET_CURRENT_USER]]);