Chatwoot/app/javascript/widget/api/conversation.js
Pranav Raj S 16fe912fbd
[Feature] Website live chat (#187)
Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2019-10-29 12:50:54 +05:30

16 lines
493 B
JavaScript
Executable file

import endPoints from 'widget/api/endPoints';
import { API } from 'widget/helpers/axios';
const sendMessageAPI = async content => {
const urlData = endPoints.sendMessage(content);
const result = await API.post(urlData.url, urlData.params);
return result;
};
const getConversationAPI = async conversationId => {
const urlData = endPoints.getConversation(conversationId);
const result = await API.get(urlData.url);
return result;
};
export { sendMessageAPI, getConversationAPI };