Created
July 2, 2025 01:35
-
-
Save kevin-machship/8d2f94489bd10a83a1566876ed211985 to your computer and use it in GitHub Desktop.
Function to handle email and phone fallbacks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getEmail = (input) => { | |
return ( | |
input?.consignment?.fromAddress?.email || | |
input?.userInformation?.email || | |
input?.company?.address?.email || | |
null | |
) | |
} | |
const getPhone = (input) => { | |
return ( | |
input?.consignment?.fromAddress?.phone || | |
input?.userInformation?.phone || | |
input?.company?.address?.phone || | |
null | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment