mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
update swell consts, cleanup cart types
This commit is contained in:
@@ -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)
|
||||
},
|
||||
|
Reference in New Issue
Block a user