Port bicycle cafés to JSON-defined-layer

This commit is contained in:
Pieter Vander Vennet 2020-09-11 02:14:16 +02:00
parent 3653c3ecaa
commit 0c2f662040
17 changed files with 229 additions and 276 deletions

View file

@ -43,14 +43,14 @@ export class ValidatedTextField {
"email": (str) => EmailValidator.validate(str),
"url": (str) => str,
"phone": (str, country) => {
return parsePhoneNumberFromString(str, country.toUpperCase())?.isValid() ?? false;
return parsePhoneNumberFromString(str, country?.toUpperCase())?.isValid() ?? false;
}
}
public static formatting = {
"phone": (str, country) => {
console.log("country formatting", country)
return parsePhoneNumberFromString(str, country.toUpperCase()).formatInternational()
return parsePhoneNumberFromString(str, country?.toUpperCase()).formatInternational()
}
}
}