mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-31 11:08:04 +00:00 
			
		
		
		
	 19ab0fe108
			
		
	
	19ab0fe108
	
	
	
		
			
			* Chore: Enable Users to create multiple accounts Addresses: #402 - migrations to split roles and other attributes from users table - make changes in code to accommodate this change Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
		
			
				
	
	
		
			25 lines
		
	
	
		
			569 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			569 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| /* eslint no-console: 0 */
 | |
| /* global axios */
 | |
| import ApiClient from '../ApiClient';
 | |
| 
 | |
| class MessageApi extends ApiClient {
 | |
|   constructor() {
 | |
|     super('conversations', { accountScoped: true });
 | |
|   }
 | |
| 
 | |
|   create({ conversationId, message, private: isPrivate }) {
 | |
|     return axios.post(`${this.url}/${conversationId}/messages`, {
 | |
|       message,
 | |
|       private: isPrivate,
 | |
|     });
 | |
|   }
 | |
| 
 | |
|   getPreviousMessages({ conversationId, before }) {
 | |
|     return axios.get(`${this.url}/${conversationId}/messages`, {
 | |
|       params: { before },
 | |
|     });
 | |
|   }
 | |
| }
 | |
| 
 | |
| export default new MessageApi();
 |