From 8101fbaccd80488a8405c987e8048649163e81fd Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Thu, 29 Feb 2024 00:31:18 +0200 Subject: [PATCH] fix phone validation --- src/helpers/common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/common.js b/src/helpers/common.js index a133fda..c1508e1 100644 --- a/src/helpers/common.js +++ b/src/helpers/common.js @@ -50,12 +50,12 @@ exports.isValidPhoneNumber = function (phone) { const cleanedPhone = phone.replace(/\s|-/g, ''); // Check if the phone starts with '08' and has 10 digits - if (cleanedPhone.startsWith('08') && cleanedPhone.length === 10) { + if ((cleanedPhone.startsWith('08') || cleanedPhone.startsWith('07')) && cleanedPhone.length === 10) { return true; } // Check if the phone starts with '+359' and has the correct length - if (cleanedPhone.startsWith('+359') && cleanedPhone.length === 12) { + if (cleanedPhone.startsWith('+359') && cleanedPhone.length === 13) { return true; }