Chore: Move conversationStats to a seperate module (#962)
* Chore: Move conversationStats to a seperate module * Move toggleTyping to conversationTypingStatus * Remove unused agentTyping flag * Fix review comments
This commit is contained in:
@@ -6,20 +6,6 @@ class FBChannel extends ApiClient {
|
||||
super('facebook_indicators', { accountScoped: true });
|
||||
}
|
||||
|
||||
markSeen({ inboxId, contactId }) {
|
||||
return axios.post(`${this.url}/mark_seen`, {
|
||||
inbox_id: inboxId,
|
||||
contact_id: contactId,
|
||||
});
|
||||
}
|
||||
|
||||
toggleTyping({ status, inboxId, contactId }) {
|
||||
return axios.post(`${this.url}/typing_${status}`, {
|
||||
inbox_id: inboxId,
|
||||
contact_id: contactId,
|
||||
});
|
||||
}
|
||||
|
||||
create(params) {
|
||||
return axios.post(
|
||||
`${this.url.replace(this.resource, '')}callbacks/register_facebook_page`,
|
||||
|
||||
@@ -9,7 +9,5 @@ describe('#FBChannel', () => {
|
||||
expect(fbChannel).toHaveProperty('create');
|
||||
expect(fbChannel).toHaveProperty('update');
|
||||
expect(fbChannel).toHaveProperty('delete');
|
||||
expect(fbChannel).toHaveProperty('markSeen');
|
||||
expect(fbChannel).toHaveProperty('toggleTyping');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import agents from '../contacts';
|
||||
import contacts from '../contacts';
|
||||
import ApiClient from '../ApiClient';
|
||||
|
||||
describe('#ContactsAPI', () => {
|
||||
it('creates correct instance', () => {
|
||||
expect(agents).toBeInstanceOf(ApiClient);
|
||||
expect(agents).toHaveProperty('get');
|
||||
expect(agents).toHaveProperty('show');
|
||||
expect(agents).toHaveProperty('create');
|
||||
expect(agents).toHaveProperty('update');
|
||||
expect(agents).toHaveProperty('delete');
|
||||
expect(agents).toHaveProperty('getConversations');
|
||||
expect(contacts).toBeInstanceOf(ApiClient);
|
||||
expect(contacts).toHaveProperty('get');
|
||||
expect(contacts).toHaveProperty('show');
|
||||
expect(contacts).toHaveProperty('create');
|
||||
expect(contacts).toHaveProperty('update');
|
||||
expect(contacts).toHaveProperty('delete');
|
||||
expect(contacts).toHaveProperty('getConversations');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user