fix: Prevent formData.append from Adding 'null' String for null replyTo (#8623)

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
This commit is contained in:
LU 2024-05-03 06:30:46 +08:00 committed by GitHub
parent f57013c92f
commit f48cff847f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -52,7 +52,9 @@ const sendAttachment = ({ attachment, replyTo = null }) => {
formData.append('message[referer_url]', referrerURL);
formData.append('message[timestamp]', timestamp);
formData.append('message[reply_to]', replyTo);
if (replyTo !== null) {
formData.append('message[reply_to]', replyTo);
}
return {
url: `/api/v1/widget/messages${window.location.search}`,
params: formData,