2019-08-14 09:48:44 +00:00
|
|
|
/* global axios */
|
|
|
|
import endPoints from './endPoints';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
getLabels() {
|
|
|
|
const urlData = endPoints('fetchLabels');
|
2019-12-21 17:24:35 +00:00
|
|
|
return axios.get(urlData.url);
|
2019-08-14 09:48:44 +00:00
|
|
|
},
|
2019-12-21 17:24:35 +00:00
|
|
|
|
2019-08-14 09:48:44 +00:00
|
|
|
getInboxes() {
|
|
|
|
const urlData = endPoints('fetchInboxes');
|
2019-12-21 17:24:35 +00:00
|
|
|
return axios.get(urlData.url);
|
2019-08-14 09:48:44 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
deleteInbox(id) {
|
|
|
|
const urlData = endPoints('inbox').delete(id);
|
2019-12-21 17:24:35 +00:00
|
|
|
return axios.delete(urlData.url);
|
2019-08-14 09:48:44 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
listInboxAgents(id) {
|
|
|
|
const urlData = endPoints('inbox').agents.get(id);
|
2019-12-21 17:24:35 +00:00
|
|
|
return axios.get(urlData.url);
|
2019-08-14 09:48:44 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
updateInboxAgents(inboxId, agentList) {
|
|
|
|
const urlData = endPoints('inbox').agents.post();
|
2019-12-21 17:24:35 +00:00
|
|
|
return axios.post(urlData.url, {
|
|
|
|
user_ids: agentList,
|
|
|
|
inbox_id: inboxId,
|
2019-08-14 09:48:44 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
};
|