shellphone.app/app/core/hooks/use-current-customer.ts
2021-07-31 22:33:18 +08:00

12 lines
334 B
TypeScript

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