saleor: shall the cart appear!

This commit is contained in:
Zaiste
2021-04-27 13:03:31 +02:00
parent 7a37bc8d4e
commit 34ab15bba4
7 changed files with 72 additions and 49 deletions

View File

@@ -30,14 +30,15 @@ export const handler: SWRHook<
checkoutId: getCheckoutId().checkoutToken,
},
})
checkout = data.node
checkout = data;
}
if (checkout?.completedAt || !checkoutId) {
checkout = await checkoutCreate(fetch)
}
return checkoutToCart({ checkout })
return checkoutToCart(checkout);
},
useHook: ({ useData }) => (input) => {
const response = useData({