mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Update Swell Provider (#359)
* fix update cart item * update types * update checkout * update get-page, cleanup types * revert change to incorrect file * cleanup Co-authored-by: Greg Hoskin <greghoskin@Gregs-MacBook-Pro.local>
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import useCustomer, { UseCustomer } from '@commerce/customer/use-customer'
|
||||
import { Customer } from '@commerce/types'
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import { normalizeCustomer } from '../utils/normalize'
|
||||
import type { CustomerHook } from '../types/customer'
|
||||
|
||||
export default useCustomer as UseCustomer<typeof handler>
|
||||
|
||||
export const handler: SWRHook<Customer | null> = {
|
||||
export const handler: SWRHook<CustomerHook> = {
|
||||
fetchOptions: {
|
||||
query: 'account',
|
||||
method: 'get',
|
||||
@@ -25,26 +25,3 @@ export const handler: SWRHook<Customer | null> = {
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
// const handler = (): { data: Customer } => {
|
||||
// const swell = getContext();
|
||||
// const response = swell.account.get();
|
||||
// const { firstName, lastName, email, company, customerGroupId, notes, phone,
|
||||
// entityId, addressCount, attributeCount, storeCredit } = response;
|
||||
// return {
|
||||
// data: {
|
||||
// firstName,
|
||||
// lastName,
|
||||
// email,
|
||||
// company,
|
||||
// customerGroupId,
|
||||
// notes,
|
||||
// phone,
|
||||
// entityId,
|
||||
// addressCount,
|
||||
// attributeCount,
|
||||
// storeCredit
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// export default handler;
|
||||
|
Reference in New Issue
Block a user