2021-02-04 07:49:59 +00:00
|
|
|
/* 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,
|
|
|
|
});
|
|
|
|
}
|
2021-03-15 13:05:56 +00:00
|
|
|
|
|
|
|
updateAgents({ teamId, agentsList }) {
|
|
|
|
return axios.patch(`${this.url}/${teamId}/team_members`, {
|
|
|
|
user_ids: agentsList,
|
|
|
|
});
|
|
|
|
}
|
2021-02-04 07:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default new TeamsAPI();
|