forked from verdnatura/salix-front
fix: refs #6818 add early return for empty phone input in parsePhone function
This commit is contained in:
parent
d4028da92e
commit
6745c15b0e
|
@ -1,6 +1,7 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
export default async function parsePhone(phone, country) {
|
export default async function parsePhone(phone, country) {
|
||||||
|
if (!phone) return;
|
||||||
if (phone.startsWith('+')) return `${phone.slice(1)}`;
|
if (phone.startsWith('+')) return `${phone.slice(1)}`;
|
||||||
if (phone.startsWith('00')) return `${phone.slice(2)}`;
|
if (phone.startsWith('00')) return `${phone.slice(2)}`;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue