Chatwoot/app/javascript/dashboard/api/contacts.js
Nithin David Thomas 864471a21e
feat: Create a new conversation from the contact panel (#2019)
* Chore: Improve button component styles
2021-04-16 20:31:07 +05:30

26 lines
590 B
JavaScript

/* global axios */
import ApiClient from './ApiClient';
class ContactAPI extends ApiClient {
constructor() {
super('contacts', { accountScoped: true });
}
get(page) {
return axios.get(`${this.url}?page=${page}`);
}
getConversations(contactId) {
return axios.get(`${this.url}/${contactId}/conversations`);
}
getContactableInboxes(contactId) {
return axios.get(`${this.url}/${contactId}/contactable_inboxes`);
}
search(search = '', page = 1) {
return axios.get(`${this.url}/search?q=${search}&page=${page}`);
}
}
export default new ContactAPI();