shellphone.app/app/core/hooks/use-customer-phone-number.ts
2021-08-01 20:04:04 +08:00

16 lines
464 B
TypeScript

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;
}