mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
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:
7
app/javascript/shared/helpers/CustomErrors.js
Normal file
7
app/javascript/shared/helpers/CustomErrors.js
Normal file
@@ -0,0 +1,7 @@
|
||||
export class DuplicateContactException extends Error {
|
||||
constructor(data) {
|
||||
super('DUPLICATE_CONTACT');
|
||||
this.data = data;
|
||||
this.name = 'DuplicateContactException';
|
||||
}
|
||||
}
|
||||
17
app/javascript/shared/helpers/specs/CustomErrors.spec.js
Normal file
17
app/javascript/shared/helpers/specs/CustomErrors.spec.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const { DuplicateContactException } = require('../CustomErrors');
|
||||
|
||||
describe('DuplicateContactException', () => {
|
||||
it('returns correct exception', () => {
|
||||
const exception = new DuplicateContactException({
|
||||
id: 1,
|
||||
name: 'contact-name',
|
||||
email: 'email@example.com',
|
||||
});
|
||||
expect(exception.message).toEqual('DUPLICATE_CONTACT');
|
||||
expect(exception.data).toEqual({
|
||||
id: 1,
|
||||
name: 'contact-name',
|
||||
email: 'email@example.com',
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user