Skip to content

Commit

Permalink
fix: Improovment in findConversation on chatWoot (#1330)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelurtado committed Jun 24, 2023
1 parent 45fddbd commit d06bd67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -21,4 +21,5 @@ userDataDir
/yarn.lock
/yarn-error.log
backupFolder
tokens/*
tokens/*
wppconnect_tokens/*
6 changes: 3 additions & 3 deletions src/util/chatWootClient.ts
Expand Up @@ -205,10 +205,10 @@ export default class chatWootClient {
async findConversation(contact: any) {
try {
const { data } = await this.api.get(
`api/v1/accounts/${this.account_id}/conversations?inbox_id=${this.inbox_id}&status=all`
`api/v1/accounts/${this.account_id}/contacts/${contact.id}/conversations`
);
return data.data.payload.find(
(e: any) => e.meta.sender.id == contact.id && e.status != 'resolved'
return data.payload.find(
(e: any) => e.inbox_id == this.inbox_id && e.status != 'resolved'
);
} catch (e) {
console.log(e);
Expand Down

0 comments on commit d06bd67

Please sign in to comment.