Chatwoot/app/javascript/dashboard/api/macros.js

21 lines
436 B
JavaScript
Raw Normal View History

2022-09-23 10:34:46 +00:00
/* global axios */
2022-09-20 11:05:41 +00:00
import ApiClient from './ApiClient';
class MacrosAPI extends ApiClient {
constructor() {
super('macros', { accountScoped: true });
}
2022-09-23 10:34:46 +00:00
getSingleMacro(macroId) {
return axios.get(`${this.url}/${macroId}`);
}
executeMacro({ macroId, conversationIds }) {
return axios.post(`${this.url}/${macroId}/execute`, {
conversation_ids: conversationIds,
});
}
2022-09-20 11:05:41 +00:00
}
export default new MacrosAPI();