mirror of
https://github.com/lingble/chatwoot.git
synced 2025-12-25 23:27:15 +00:00
41 lines
941 B
JavaScript
41 lines
941 B
JavaScript
/* global axios */
|
|
import CacheEnabledApiClient from './CacheEnabledApiClient';
|
|
// import ApiClient from './ApiClient';
|
|
import ApiClient from './ApiClient';
|
|
|
|
// eslint-disable-next-line no-underscore-dangle
|
|
const BaseClass = window.__WOOT_ISOLATED_SHELL__
|
|
? ApiClient
|
|
: CacheEnabledApiClient;
|
|
|
|
class Inboxes extends BaseClass {
|
|
constructor() {
|
|
super('inboxes', { accountScoped: true });
|
|
}
|
|
|
|
// eslint-disable-next-line class-methods-use-this
|
|
get cacheModelName() {
|
|
return 'inbox';
|
|
}
|
|
|
|
getCampaigns(inboxId) {
|
|
return axios.get(`${this.url}/${inboxId}/campaigns`);
|
|
}
|
|
|
|
deleteInboxAvatar(inboxId) {
|
|
return axios.delete(`${this.url}/${inboxId}/avatar`);
|
|
}
|
|
|
|
getAgentBot(inboxId) {
|
|
return axios.get(`${this.url}/${inboxId}/agent_bot`);
|
|
}
|
|
|
|
setAgentBot(inboxId, botId) {
|
|
return axios.post(`${this.url}/${inboxId}/set_agent_bot`, {
|
|
agent_bot: botId,
|
|
});
|
|
}
|
|
}
|
|
|
|
export default new Inboxes();
|