Custom Checkout Progress

This commit is contained in:
Bel Curcio
2021-05-27 14:23:55 -03:00
parent 8fb6c7b206
commit 7c1344a19e
60 changed files with 869 additions and 252 deletions

View File

@@ -10,15 +10,11 @@ export const handler: SWRHook<Customer | null> = {
query: getCustomerQuery,
},
async fetcher({ options, fetch }) {
const customerAccessToken = getCustomerToken()
if (customerAccessToken) {
const data = await fetch({
...options,
variables: { customerAccessToken: getCustomerToken() },
})
return data.customer
}
return null
const data = await fetch<any | null>({
...options,
variables: { customerAccessToken: getCustomerToken() },
})
return data.customer ?? null
},
useHook: ({ useData }) => (input) => {
return useData({