shellphone.app/app/core/hooks/use-current-customer.ts

12 lines
338 B
TypeScript
Raw Normal View History

import { useQuery } from "blitz";
2021-07-31 14:33:18 +00:00
import getCurrentCustomer from "../../customers/queries/get-current-customer";
2021-07-31 14:33:18 +00:00
export default function useCurrentCustomer() {
const [customer] = useQuery(getCurrentCustomer, null);
2021-07-31 14:33:18 +00:00
return {
customer,
hasCompletedOnboarding: Boolean(!!customer && customer.accountSid && customer.authToken),
};
2021-07-31 14:33:18 +00:00
}