feat: add type in hook

This commit is contained in:
DuvCharles 2023-02-23 17:38:45 +01:00 committed by Hadrien Lucas
parent af565bb2a4
commit 7ab1d9a50d
2 changed files with 3 additions and 2 deletions

View File

@ -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',

View File

@ -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,
}
}