feat: Ability to edit a contact (#1092)

Ability to edit contact information in conversation sidebar

Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
Pranav Raj S
2020-08-23 00:05:07 +05:30
committed by GitHub
parent ec6cd4bbba
commit 8cf05f1d9f
23 changed files with 709 additions and 133 deletions

View File

@@ -1,4 +1,4 @@
/* eslint no-param-reassign: 0 */
import { DuplicateContactException } from 'shared/helpers/CustomErrors';
import * as types from '../mutation-types';
import ContactAPI from '../../api/contacts';
import Vue from 'vue';
@@ -56,7 +56,11 @@ export const actions = {
commit(types.default.SET_CONTACT_UI_FLAG, { isUpdating: false });
} catch (error) {
commit(types.default.SET_CONTACT_UI_FLAG, { isUpdating: false });
throw new Error(error);
if (error.response?.data?.contact) {
throw new DuplicateContactException(error.response.data.contact);
} else {
throw new Error(error);
}
}
},