mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 07:26:59 +00:00
fix: Customer request without customerId
This commit is contained in:
parent
16a9862b53
commit
1cb1824af1
@ -14,14 +14,15 @@ export const handler: SWRHook<CustomerHook> = {
|
||||
method: 'GET',
|
||||
},
|
||||
async fetcher({ options, fetch }) {
|
||||
const data = await fetch({...options})
|
||||
const data: any = customerId ? await fetch({ ...options }) : null
|
||||
|
||||
return data ? ({
|
||||
firstName: '',
|
||||
lastName: '',
|
||||
email: data.attributes.email ?? '',
|
||||
} as any)
|
||||
: null
|
||||
return data
|
||||
? ({
|
||||
firstName: '',
|
||||
lastName: '',
|
||||
email: data.attributes.email ?? '',
|
||||
} as any)
|
||||
: null
|
||||
},
|
||||
|
||||
useHook:
|
||||
|
Loading…
x
Reference in New Issue
Block a user