fix: fix error when attempting to format an invalid phone number string
This commit is contained in:
parent
b1ac484c0b
commit
e2970bea48
2 changed files with 7 additions and 5 deletions
|
|
@ -10,10 +10,12 @@ const getAuthorizedStatus = it =>
|
|||
? { label: `${it.daysSuspended} day suspension`, type: 'warning' }
|
||||
: { label: 'Authorized', type: 'success' }
|
||||
|
||||
const getFormattedPhone = (phone, country) =>
|
||||
phone && country
|
||||
? parsePhoneNumberFromString(phone, country).formatInternational()
|
||||
: ''
|
||||
const getFormattedPhone = (phone, country) => {
|
||||
const phoneNumber =
|
||||
phone && country ? parsePhoneNumberFromString(phone, country) : null
|
||||
|
||||
return phoneNumber ? phoneNumber.formatInternational() : phone
|
||||
}
|
||||
|
||||
const getName = it => {
|
||||
const idData = R.path(['idCardData'])(it)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { makeStyles } from '@material-ui/core'
|
||||
import React from 'react'
|
||||
import OperatorInfo from 'src/pages/OperatorInfo/OperatorInfo'
|
||||
|
||||
import styles from 'src/pages/AddMachine/styles'
|
||||
import OperatorInfo from 'src/pages/OperatorInfo/OperatorInfo'
|
||||
|
||||
const useStyles = makeStyles(styles)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue