Skip to content

Commit

Permalink
Merge pull request #662 from drauber/cwId_missing
Browse files Browse the repository at this point in the history
Add -cwId- when findByName
  • Loading branch information
DavidsonGomes authored Jun 26, 2024
2 parents f5bd11f + 86b2999 commit 14ea5d9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/api/integrations/chatwoot/services/chatwoot.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,12 @@ export class ChatwootService {
}

this.logger.verbose('find inbox by name');
const findByName = inbox.payload.find((inbox) => inbox.name === this.getClientCwConfig().name_inbox);
let findByName = inbox.payload.find((inbox) => inbox.name === this.getClientCwConfig().name_inbox);

if (!findByName) {
findByName = inbox.payload.find((inbox) => inbox.name === this.getClientCwConfig().name_inbox.split('-cwId-')[0]);
}


if (!findByName) {
this.logger.warn('inbox not found');
Expand Down

0 comments on commit 14ea5d9

Please sign in to comment.