mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-30 18:47:51 +00:00
- Adds pagination support for search. - Use composition API on all search related component. - Minor UI improvements. - Adds missing specs Loom video https://www.loom.com/share/5b01afa5c9204e7d97ff81b215621dde?sid=82ca6d22-ca8c-4d5e-8740-ba06ca4051ba
46 lines
741 B
JavaScript
46 lines
741 B
JavaScript
/* global axios */
|
|
import ApiClient from './ApiClient';
|
|
|
|
class SearchAPI extends ApiClient {
|
|
constructor() {
|
|
super('search', { accountScoped: true });
|
|
}
|
|
|
|
get({ q }) {
|
|
return axios.get(this.url, {
|
|
params: {
|
|
q,
|
|
},
|
|
});
|
|
}
|
|
|
|
contacts({ q, page = 1 }) {
|
|
return axios.get(`${this.url}/contacts`, {
|
|
params: {
|
|
q,
|
|
page: page,
|
|
},
|
|
});
|
|
}
|
|
|
|
conversations({ q, page = 1 }) {
|
|
return axios.get(`${this.url}/conversations`, {
|
|
params: {
|
|
q,
|
|
page: page,
|
|
},
|
|
});
|
|
}
|
|
|
|
messages({ q, page = 1 }) {
|
|
return axios.get(`${this.url}/messages`, {
|
|
params: {
|
|
q,
|
|
page: page,
|
|
},
|
|
});
|
|
}
|
|
}
|
|
|
|
export default new SearchAPI();
|