matias-delavega-dg-dmi 716b540966
TEC-252 and TEC-256: Implementing fetchers, products list and search (#5)
* TEC-252: Base integration with commercetools using fetchers for REST and GraphQL endpoints

* TEC-252: WIP commenting some components that are failing while we don't have all the hooks defined

* add sdk integration

* TEC-256: Implementing product search

* TEC-256: removing unnecessary env variables

* TEC-256: review comments

* TEC-256: other remaining review fixes

Co-authored-by: nicossosa93 <nicolas.sosa@devgurus.io>
2021-06-30 10:05:26 -03:00

25 lines
1020 B
TypeScript

import { Provider } from '@commerce'
// import { handler as useCart } from './cart/use-cart'
// import { handler as useAddItem } from './cart/use-add-item'
// import { handler as useUpdateItem } from './cart/use-update-item'
// import { handler as useRemoveItem } from './cart/use-remove-item'
// import { handler as useCustomer } from './customer/use-customer'
import { handler as useSearch } from './product/use-search'
// import { handler as useLogin } from './auth/use-login'
// import { handler as useLogout } from './auth/use-logout'
// import { handler as useSignup } from './auth/use-signup'
import fetcher from './fetcher'
// Export a provider with the CommerceHooks
export const commercetoolsProvider: Provider = {
locale: 'en-us',
cartCookie: 'session',
fetcher,
// cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },
// customer: { useCustomer },
products: { useSearch },
// auth: { useLogin, useLogout, useSignup }
}
export type CommercetoolsProvider = typeof commercetoolsProvider