saleor: update the provider structure

This commit is contained in:
Zaiste
2021-06-04 22:43:28 +02:00
parent 79e916f6ee
commit 33992283b3
44 changed files with 580 additions and 513 deletions

View File

@@ -1,14 +1,14 @@
import { useMemo } from 'react'
import useCommerceCart, { FetchCartInput, UseCart } from '@commerce/cart/use-cart'
import useCommerceCart, { UseCart } from '@commerce/cart/use-cart'
import { Cart } from '../types'
import { SWRHook } from '@commerce/utils/types'
import { checkoutCreate, checkoutToCart, getCheckoutId } from '../utils'
import * as query from '../utils/queries'
import { GetCartHook } from '@commerce/types/cart'
export default useCommerceCart as UseCart<typeof handler>
export const handler: SWRHook<Cart | null, {}, FetchCartInput, { isEmpty?: boolean }> = {
export const handler: SWRHook<GetCartHook> = {
fetchOptions: {
query: query.CheckoutOne,
},