Update use-add-item.tsx

This commit is contained in:
cond0r 2021-02-18 15:52:18 +02:00
parent ce5fcb6975
commit e1be0ac37d

View File

@ -14,7 +14,9 @@ export const handler: MutationHandler<Cart, {}, AddCartItemBody> = {
fetchOptions: {
query: checkoutLineItemAddMutation,
},
async fetcher({ input: { item }, options, fetch }) {
async fetcher({ input, options, fetch }) {
const item = input?.item ?? input
if (
item.quantity &&
(!Number.isInteger(item.quantity) || item.quantity! < 1)