Chatwoot/app/javascript/dashboard/api/account.js
Pranav Raj S 2ce7438c79 [Refactor] Cleanup agent store and actions (#373)
* Cleanup agent store and actions

* Move set/create/update/destroy to helpers

* Update mutation specs

* Add specs for API helper

* Fix edit/delete action visibility

* Add actions specs

* Remove unused API helpers

* Remove duplicates

* Remove duplicates

* Fix duplicate
2019-12-21 22:54:35 +05:30

32 lines
718 B
JavaScript

/* global axios */
import endPoints from './endPoints';
export default {
getLabels() {
const urlData = endPoints('fetchLabels');
return axios.get(urlData.url);
},
getInboxes() {
const urlData = endPoints('fetchInboxes');
return axios.get(urlData.url);
},
deleteInbox(id) {
const urlData = endPoints('inbox').delete(id);
return axios.delete(urlData.url);
},
listInboxAgents(id) {
const urlData = endPoints('inbox').agents.get(id);
return axios.get(urlData.url);
},
updateInboxAgents(inboxId, agentList) {
const urlData = endPoints('inbox').agents.post();
return axios.post(urlData.url, {
user_ids: agentList,
inbox_id: inboxId,
});
},
};