2019-10-29 07:20:54 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2019-12-11 15:27:06 +00:00
|
|
|
const getConversationAPI = async ({ before }) => {
|
|
|
|
const urlData = endPoints.getConversation({ before });
|
|
|
|
const result = await API.get(urlData.url, { params: urlData.params });
|
2019-10-29 07:20:54 +00:00
|
|
|
return result;
|
|
|
|
};
|
|
|
|
|
|
|
|
export { sendMessageAPI, getConversationAPI };
|