mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-11-03 20:48:07 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			577 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			577 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
/* global axios */
 | 
						|
import ApiClient from './ApiClient';
 | 
						|
 | 
						|
export class TeamsAPI extends ApiClient {
 | 
						|
  constructor() {
 | 
						|
    super('teams', { accountScoped: true });
 | 
						|
  }
 | 
						|
 | 
						|
  getAgents({ teamId }) {
 | 
						|
    return axios.get(`${this.url}/${teamId}/team_members`);
 | 
						|
  }
 | 
						|
 | 
						|
  addAgents({ teamId, agentsList }) {
 | 
						|
    return axios.post(`${this.url}/${teamId}/team_members`, {
 | 
						|
      user_ids: agentsList,
 | 
						|
    });
 | 
						|
  }
 | 
						|
 | 
						|
  updateAgents({ teamId, agentsList }) {
 | 
						|
    return axios.patch(`${this.url}/${teamId}/team_members`, {
 | 
						|
      user_ids: agentsList,
 | 
						|
    });
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
export default new TeamsAPI();
 |