Adding Modal Component and Login View

This commit is contained in:
Belen Curcio
2020-10-19 15:22:48 -03:00
parent a3e021ec79
commit 26535b7c7f
11 changed files with 122 additions and 12 deletions

View File

@@ -19,10 +19,12 @@ export default function useCart<T>(
swrOptions?: ConfigInterface<T | null>
) {
const { cartCookie } = useCommerce()
const fetcher: typeof fetcherFn = (options, input, fetch) => {
input.cartId = Cookies.get(cartCookie)
return fetcherFn(options, input, fetch)
}
const response = useData(options, input, fetcher, swrOptions)
return Object.assign(response, { isEmpty: true }) as CartResponse<T>