Chatwoot/app/javascript/dashboard/api/contacts.js
Nithin David Thomas f214c9c47c
feat: Add Contacts page (#1335)
Co-authored-by: Sojan <sojan@pepalo.com>
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-11-10 15:25:26 +05:30

22 lines
478 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`);
}
search(search = '', page = 1) {
return axios.get(`${this.url}/search?q=${search}&page=${page}`);
}
}
export default new ContactAPI();