2019-10-29 07:20:54 +00:00
|
|
|
const sendMessage = content => ({
|
|
|
|
url: `/api/v1/widget/messages${window.location.search}`,
|
|
|
|
params: {
|
|
|
|
message: {
|
|
|
|
content,
|
2020-01-01 17:00:43 +00:00
|
|
|
timestamp: new Date().toString(),
|
|
|
|
referer_url: window.refererURL || '',
|
2019-10-29 07:20:54 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2019-12-11 15:27:06 +00:00
|
|
|
const getConversation = ({ before }) => ({
|
2019-10-29 07:20:54 +00:00
|
|
|
url: `/api/v1/widget/messages${window.location.search}`,
|
2019-12-11 15:27:06 +00:00
|
|
|
params: { before },
|
2019-10-29 07:20:54 +00:00
|
|
|
});
|
|
|
|
|
2020-01-09 07:36:40 +00:00
|
|
|
const updateContact = id => ({
|
|
|
|
url: `/api/v1/widget/messages/${id}${window.location.search}`,
|
|
|
|
});
|
|
|
|
|
2019-10-29 07:20:54 +00:00
|
|
|
export default {
|
|
|
|
sendMessage,
|
|
|
|
getConversation,
|
2020-01-09 07:36:40 +00:00
|
|
|
updateContact,
|
2019-10-29 07:20:54 +00:00
|
|
|
};
|