From 4d4f91264421c4cbbc46c92395cfcef74a1e7b69 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Wed, 28 Feb 2024 22:26:42 +0200 Subject: [PATCH] fix phone imports --- .env | 2 ++ .env.development | 3 ++- pages/cart/publishers/import.tsx | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 2cf2b5e..1973ac5 100644 --- a/.env +++ b/.env @@ -16,6 +16,8 @@ DATABASE_PROVIDER=mysql DATABASE_URL=mysql://root:Zelen0ku4e@192.168.0.10:3306/cart_dev # DATABASE_URL=mysql://cart:cartpw@20.101.62.76:3307/cart +#DATABASE_URL=mysql://cart:cartpw@localhost:3306/cart # migrate deploy #dev + APPLE_ID= APPLE_TEAM_ID= APPLE_PRIVATE_KEY= diff --git a/.env.development b/.env.development index 3c82532..fd8b12b 100644 --- a/.env.development +++ b/.env.development @@ -10,6 +10,7 @@ SSL_ENABLED=true SSL_KEY=./certificates/localhost-key.pem SSL_CERT=./certificates/localhost.pem -DATABASE_URL=mysql://root:Zelen0ku4e@192.168.0.10:3306/cart_dev +# DATABASE_URL=mysql://root:Zelen0ku4e@192.168.0.10:3306/cart_dev +DATABASE_URL=mysql://cart:cartpw@localhost:3306/cart TELEGRAM_BOT=true \ No newline at end of file diff --git a/pages/cart/publishers/import.tsx b/pages/cart/publishers/import.tsx index bb75768..4acacd3 100644 --- a/pages/cart/publishers/import.tsx +++ b/pages/cart/publishers/import.tsx @@ -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 }