fix phone imports

This commit is contained in:
Dobromir Popov
2024-02-28 22:26:42 +02:00
parent ea0cfeb0db
commit 4d4f912644
3 changed files with 5 additions and 2 deletions

View File

@ -155,7 +155,7 @@ export default function ImportPage() {
//phone = phone.replace(/(?!^\+)\D/g, '');
phone = phone.replace(/[^+\d]/g, '');
if (phone.startsWith('8') || phone.startsWith('9')) {
phone = '+359' + phone.substring(1); // Assumes all numbers starting with 8 are Bulgarian and should have +359
phone = '+359' + phone
} else if (!phone.startsWith('+')) {
phone = '+' + phone; // Add + if it's missing, assuming the number is complete
}