Feature: Customise widget for bot conversations (#834)

* Feature: Customise widget for bot conversations
This commit is contained in:
Pranav Raj S
2020-05-09 22:02:43 +05:30
committed by GitHub
parent 05ea6308f2
commit f28ec29b8c
24 changed files with 298 additions and 26 deletions

View File

@@ -13,12 +13,16 @@ const sendAttachmentAPI = async attachment => {
return result;
};
const getConversationAPI = async ({ before }) => {
const getMessagesAPI = async ({ before }) => {
const urlData = endPoints.getConversation({ before });
const result = await API.get(urlData.url, { params: urlData.params });
return result;
};
const getConversationAPI = async () => {
return API.get(`/api/v1/widget/conversations${window.location.search}`);
};
const toggleTyping = async ({ typingStatus }) => {
return API.post(
`/api/v1/widget/conversations/toggle_typing${window.location.search}`,
@@ -26,4 +30,10 @@ const toggleTyping = async ({ typingStatus }) => {
);
};
export { sendMessageAPI, getConversationAPI, sendAttachmentAPI, toggleTyping };
export {
sendMessageAPI,
getConversationAPI,
getMessagesAPI,
sendAttachmentAPI,
toggleTyping,
};