mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-31 19:17:48 +00:00 
			
		
		
		
	 402428fb4d
			
		
	
	402428fb4d
	
	
	
		
			
			* feat: Splits search api by resources to improve query time * Review fixes * Spacing fixes * Update app/javascript/dashboard/modules/search/components/SearchView.vue Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> * Review fixes * Refactor searchview --------- Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
		
			
				
	
	
		
			43 lines
		
	
	
		
			651 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			651 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 }) {
 | |
|     return axios.get(`${this.url}/contacts`, {
 | |
|       params: {
 | |
|         q,
 | |
|       },
 | |
|     });
 | |
|   }
 | |
| 
 | |
|   conversations({ q }) {
 | |
|     return axios.get(`${this.url}/conversations`, {
 | |
|       params: {
 | |
|         q,
 | |
|       },
 | |
|     });
 | |
|   }
 | |
| 
 | |
|   messages({ q }) {
 | |
|     return axios.get(`${this.url}/messages`, {
 | |
|       params: {
 | |
|         q,
 | |
|       },
 | |
|     });
 | |
|   }
 | |
| }
 | |
| 
 | |
| export default new SearchAPI();
 |