mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-30 18:47:51 +00:00 
			
		
		
		
	 9fb0dfa4a7
			
		
	
	9fb0dfa4a7
	
	
	
		
			
			### Tools list <img width="2316" height="666" alt="CleanShot 2025-10-03 at 20 42 41@2x" src="https://github.com/user-attachments/assets/ccbffd16-804d-4eb8-9c64-2d1cfd407e4e" /> ### Tools form <img width="2294" height="2202" alt="CleanShot 2025-10-03 at 20 43 05@2x" src="https://github.com/user-attachments/assets/9f49aa09-75a1-4585-a09d-837ca64139b8" /> ## Response <img width="800" height="2144" alt="CleanShot 2025-10-03 at 20 45 56@2x" src="https://github.com/user-attachments/assets/b0c3c899-6050-4c51-baed-c8fbec5aae61" /> --------- Co-authored-by: Pranav <pranavrajs@gmail.com> Co-authored-by: Pranav <pranav@chatwoot.com>
		
			
				
	
	
		
			25 lines
		
	
	
		
			753 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			753 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import { createStore } from './storeFactory';
 | |
| import CaptainToolsAPI from '../../api/captain/tools';
 | |
| import { throwErrorMessage } from 'dashboard/store/utils/api';
 | |
| 
 | |
| const toolsStore = createStore({
 | |
|   name: 'Tools',
 | |
|   API: CaptainToolsAPI,
 | |
|   actions: mutations => ({
 | |
|     getTools: async ({ commit }) => {
 | |
|       commit(mutations.SET_UI_FLAG, { fetchingList: true });
 | |
|       try {
 | |
|         const response = await CaptainToolsAPI.get();
 | |
|         commit(mutations.SET, response.data);
 | |
|         commit(mutations.SET_UI_FLAG, { fetchingList: false });
 | |
|         return response.data;
 | |
|       } catch (error) {
 | |
|         commit(mutations.SET_UI_FLAG, { fetchingList: false });
 | |
|         return throwErrorMessage(error);
 | |
|       }
 | |
|     },
 | |
|   }),
 | |
| });
 | |
| 
 | |
| export default toolsStore;
 |