diff --git a/framework/commercelayer/api/utils/normalizeLineItems.tsx b/framework/commercelayer/api/utils/normalizeLineItems.ts similarity index 100% rename from framework/commercelayer/api/utils/normalizeLineItems.tsx rename to framework/commercelayer/api/utils/normalizeLineItems.ts diff --git a/framework/commercelayer/customer/use-customer.tsx b/framework/commercelayer/customer/use-customer.tsx index 2bc46d879..b1feb76a3 100644 --- a/framework/commercelayer/customer/use-customer.tsx +++ b/framework/commercelayer/customer/use-customer.tsx @@ -14,14 +14,15 @@ export const handler: SWRHook = { method: 'GET', }, async fetcher({ options, fetch }) { - const data = await fetch({...options}) - - return data ? ({ - firstName: '', - lastName: '', - email: data.attributes.email ?? '', - } as any) - : null + const data: any = customerId ? await fetch({ ...options }) : null + + return data + ? ({ + firstName: '', + lastName: '', + email: data.attributes.email ?? '', + } as any) + : null }, useHook: