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

16 lines
463 B
TypeScript
Raw Normal View History

import { useQuery } from "blitz";
2021-07-31 14:33:18 +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() {
const { hasCompletedOnboarding } = useCurrentCustomer();
2021-07-31 14:33:18 +00:00
const [customerPhoneNumber] = useQuery(
getCurrentCustomerPhoneNumber,
{},
{ enabled: hasCompletedOnboarding }
);
2021-07-31 14:33:18 +00:00
return customerPhoneNumber;
2021-07-31 14:33:18 +00:00
}