mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
feat: show ReplyTo in widget UI (#8094)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -22,7 +22,7 @@ const createConversation = params => {
|
||||
};
|
||||
};
|
||||
|
||||
const sendMessage = content => {
|
||||
const sendMessage = (content, replyTo) => {
|
||||
const referrerURL = window.referrerURL || '';
|
||||
const search = buildSearchParamsWithLocale(window.location.search);
|
||||
return {
|
||||
@@ -30,6 +30,7 @@ const sendMessage = content => {
|
||||
params: {
|
||||
message: {
|
||||
content,
|
||||
reply_to: replyTo,
|
||||
timestamp: new Date().toString(),
|
||||
referer_url: referrerURL,
|
||||
},
|
||||
@@ -37,7 +38,7 @@ const sendMessage = content => {
|
||||
};
|
||||
};
|
||||
|
||||
const sendAttachment = ({ attachment }) => {
|
||||
const sendAttachment = ({ attachment, replyTo = null }) => {
|
||||
const { referrerURL = '' } = window;
|
||||
const timestamp = new Date().toString();
|
||||
const { file } = attachment;
|
||||
@@ -51,6 +52,7 @@ const sendAttachment = ({ attachment }) => {
|
||||
|
||||
formData.append('message[referer_url]', referrerURL);
|
||||
formData.append('message[timestamp]', timestamp);
|
||||
formData.append('message[reply_to]', replyTo);
|
||||
return {
|
||||
url: `/api/v1/widget/messages${window.location.search}`,
|
||||
params: formData,
|
||||
|
||||
Reference in New Issue
Block a user