update swell consts, cleanup cart types

This commit is contained in:
Greg Hoskin
2021-05-11 14:28:46 -05:00
parent 7786d6445d
commit 9675be1546
6 changed files with 15 additions and 23 deletions

View File

@@ -14,7 +14,6 @@ import useCart from './use-cart'
import { handler as removeItemHandler } from './use-remove-item'
import type { Cart, LineItem, UpdateCartItemBody } from '../types'
import { checkoutToCart } from './utils'
import { Mutation, MutationCheckoutLineItemsUpdateArgs } from '../schema'
export type UpdateItemInput<T = any> = T extends LineItem
? Partial<UpdateItemInputBase<LineItem>>
@@ -46,12 +45,10 @@ export const handler = {
message: 'The item quantity has to be a valid integer',
})
}
const response = await fetch<Mutation, MutationCheckoutLineItemsUpdateArgs>(
{
...options,
variables: [item.itemId, { quantity: item.quantity }],
}
)
const response = await fetch({
...options,
variables: [item.itemId, { quantity: item.quantity }],
})
return checkoutToCart(response)
},