Skip to content

Commit aa8396d

Browse files
committed
refactor: Update content_attributes in ChatwootService
This commit refactors the code in ChatwootService to update the content_attributes when replyToIds are present. Instead of directly spreading the replyToIds object, the code now converts it to a JSON string and appends it to the data object. Refactor the code to improve readability and maintainability.
1 parent ec2b7f9 commit aa8396d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -954,9 +954,10 @@ export class ChatwootService {
954954
const replyToIds = await this.getReplyToIds(messageBody, instance);
955955

956956
if (replyToIds.in_reply_to || replyToIds.in_reply_to_external_id) {
957-
data.append('content_attributes', {
958-
...replyToIds,
959-
});
957+
const content = JSON.stringify({
958+
...replyToIds
959+
})
960+
data.append('content_attributes', content);
960961
}
961962
}
962963

0 commit comments

Comments
 (0)