shellphone.app/app/core/hooks/use-customer-phone-number.ts

16 lines
457 B
TypeScript
Raw Normal View History

2021-07-31 14:33:18 +00:00
import { useQuery } from "blitz"
import getCurrentCustomerPhoneNumber from "../../phone-numbers/queries/get-current-customer-phone-number"
import useCurrentCustomer from "./use-current-customer"
export default function useCustomerPhoneNumber() {
const { hasCompletedOnboarding } = useCurrentCustomer()
const [customerPhoneNumber] = useQuery(
getCurrentCustomerPhoneNumber,
{},
{ enabled: hasCompletedOnboarding }
)
return customerPhoneNumber
}