mirror of
https://github.com/vercel/commerce.git
synced 2025-06-09 09:36:58 +00:00
feat: add type in hook
This commit is contained in:
parent
af565bb2a4
commit
7ab1d9a50d
@ -3,10 +3,11 @@ import { SWRHook } from '@vercel/commerce/utils/types'
|
||||
import useCart, { UseCart } from '@vercel/commerce/cart/use-cart'
|
||||
import { getCartToken } from '../utils/token/cart-token'
|
||||
import { normalizeCart } from '../utils/normalize/normalize-cart'
|
||||
import { GetCartHook } from '@vercel/commerce/types/cart'
|
||||
|
||||
export default useCart as UseCart<typeof handler>
|
||||
|
||||
export const handler: SWRHook<any> = {
|
||||
export const handler: SWRHook<GetCartHook> = {
|
||||
fetchOptions: {
|
||||
url: `/api/v2/shop/orders`,
|
||||
method: 'GET',
|
||||
|
@ -116,7 +116,7 @@ export const normalizeProductImage = (
|
||||
image: SyliusProductImage
|
||||
): ProductImage => {
|
||||
return {
|
||||
url: process.env.NEXT_PUBLIC_SYLIUS_ALLOWED_IMAGE_URL + image.path,
|
||||
url: process.env.NEXT_PUBLIC_SYLIUS_API_URL + image.path,
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user