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