forked from crowetic/commerce
Removed Body type
This commit is contained in:
parent
0f4f061cbd
commit
0ec552c2b8
@ -9,8 +9,6 @@ import addItem from './handlers/add-item'
|
||||
import updateItem from './handlers/update-item'
|
||||
import removeItem from './handlers/remove-item'
|
||||
|
||||
type Body<T> = Partial<T> | undefined
|
||||
|
||||
export type ItemBody = {
|
||||
productId: number
|
||||
variantId: number
|
||||
@ -46,14 +44,14 @@ export type Cart = {
|
||||
|
||||
export type CartHandlers = {
|
||||
getCart: BigcommerceHandler<Cart, { cartId?: string }>
|
||||
addItem: BigcommerceHandler<Cart, { cartId?: string } & Body<AddItemBody>>
|
||||
addItem: BigcommerceHandler<Cart, { cartId?: string } & Partial<AddItemBody>>
|
||||
updateItem: BigcommerceHandler<
|
||||
Cart,
|
||||
{ cartId?: string } & Body<UpdateItemBody>
|
||||
{ cartId?: string } & Partial<UpdateItemBody>
|
||||
>
|
||||
removeItem: BigcommerceHandler<
|
||||
Cart,
|
||||
{ cartId?: string } & Body<RemoveItemBody>
|
||||
{ cartId?: string } & Partial<RemoveItemBody>
|
||||
>
|
||||
}
|
||||
|
||||
|
@ -13,8 +13,6 @@ import removeWishlist from './handlers/remove-wishlist'
|
||||
import addWishlist from './handlers/add-wishlist'
|
||||
import { definitions } from '../definitions/wishlist'
|
||||
|
||||
type Body<T> = Partial<T> | undefined
|
||||
|
||||
export type ItemBody = {
|
||||
productId: number
|
||||
variantId: number
|
||||
@ -40,19 +38,19 @@ export type WishlistHandlers = {
|
||||
getWishlist: BigcommerceHandler<Wishlist, { customerToken?: string }>
|
||||
addWishlist: BigcommerceHandler<
|
||||
Wishlist,
|
||||
{ wishlistId: string } & Body<AddWishlistBody>
|
||||
{ wishlistId: string } & Partial<AddWishlistBody>
|
||||
>
|
||||
updateWishlist: BigcommerceHandler<
|
||||
Wishlist,
|
||||
{ wishlistId: string } & Body<AddWishlistBody>
|
||||
{ wishlistId: string } & Partial<AddWishlistBody>
|
||||
>
|
||||
addItem: BigcommerceHandler<
|
||||
Wishlist,
|
||||
{ customerToken?: string } & Body<AddItemBody>
|
||||
{ customerToken?: string } & Partial<AddItemBody>
|
||||
>
|
||||
removeItem: BigcommerceHandler<
|
||||
Wishlist,
|
||||
{ customerToken?: string } & Body<RemoveItemBody>
|
||||
{ customerToken?: string } & Partial<RemoveItemBody>
|
||||
>
|
||||
removeWishlist: BigcommerceHandler<Wishlist, { wishlistId: string }>
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user