|
|
|
@ -683,8 +683,8 @@ export const handleNotification = (title, _options) => {
|
|
|
|
|
* - Phone numbers in Mexico (country code "52") need to have "1" after "+52", even if they're Nextel numbers.
|
|
|
|
|
*/
|
|
|
|
|
export const phoneNumberToWAID = (input) => {
|
|
|
|
|
// Remove any non-digit characters except '+'
|
|
|
|
|
const cleanedInput = (input.replace(/[^\d+]/g, ''))
|
|
|
|
|
// Remove any non-digit characters
|
|
|
|
|
const cleanedInput = (input.replace(/[^\d]/g, ''))
|
|
|
|
|
.replace(/^0+/, '') // Remove leading zeros
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
@ -716,8 +716,8 @@ export const phoneNumberToWAID = (input) => {
|
|
|
|
|
formattedNumber = `52 1 ${formattedNumber.slice(2)}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Remove any non-digit characters except '+'
|
|
|
|
|
formattedNumber = formattedNumber.replace(/[^\d+]/g, '');
|
|
|
|
|
// Remove any non-digit characters
|
|
|
|
|
formattedNumber = formattedNumber.replace(/[^\d]/g, '');
|
|
|
|
|
|
|
|
|
|
return formattedNumber;
|
|
|
|
|
}
|
|
|
|
|