mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-23 21:57:45 -06:00
fix(chatwoot): improve jid normalization and type safety in chatwoot integration
Refactor to preserve LID identifiers and update parameter type for better type safety as per code review feedback.
This commit is contained in:
@@ -1609,7 +1609,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
// This enables LID to phoneNumber conversion without breaking existing webhook consumers
|
||||
|
||||
// Helper to normalize participantId as phone number
|
||||
const normalizePhoneNumber = (id: string | any): string => {
|
||||
const normalizePhoneNumber = (id: string | null | undefined): string => {
|
||||
// Remove @lid, @s.whatsapp.net suffixes and extract just the number part
|
||||
return String(id || '').split('@')[0];
|
||||
};
|
||||
|
||||
@@ -2527,7 +2527,7 @@ export class ChatwootService {
|
||||
}
|
||||
}
|
||||
|
||||
public getNumberFromRemoteJid(remoteJid: string) {
|
||||
public normalizeJidIdentifier(remoteJid: string) {
|
||||
if (!remoteJid) {
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user