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 updateItem from './handlers/update-item'
|
||||||
import removeItem from './handlers/remove-item'
|
import removeItem from './handlers/remove-item'
|
||||||
|
|
||||||
type Body<T> = Partial<T> | undefined
|
|
||||||
|
|
||||||
export type ItemBody = {
|
export type ItemBody = {
|
||||||
productId: number
|
productId: number
|
||||||
variantId: number
|
variantId: number
|
||||||
@ -46,14 +44,14 @@ export type Cart = {
|
|||||||
|
|
||||||
export type CartHandlers = {
|
export type CartHandlers = {
|
||||||
getCart: BigcommerceHandler<Cart, { cartId?: string }>
|
getCart: BigcommerceHandler<Cart, { cartId?: string }>
|
||||||
addItem: BigcommerceHandler<Cart, { cartId?: string } & Body<AddItemBody>>
|
addItem: BigcommerceHandler<Cart, { cartId?: string } & Partial<AddItemBody>>
|
||||||
updateItem: BigcommerceHandler<
|
updateItem: BigcommerceHandler<
|
||||||
Cart,
|
Cart,
|
||||||
{ cartId?: string } & Body<UpdateItemBody>
|
{ cartId?: string } & Partial<UpdateItemBody>
|
||||||
>
|
>
|
||||||
removeItem: BigcommerceHandler<
|
removeItem: BigcommerceHandler<
|
||||||
Cart,
|
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 addWishlist from './handlers/add-wishlist'
|
||||||
import { definitions } from '../definitions/wishlist'
|
import { definitions } from '../definitions/wishlist'
|
||||||
|
|
||||||
type Body<T> = Partial<T> | undefined
|
|
||||||
|
|
||||||
export type ItemBody = {
|
export type ItemBody = {
|
||||||
productId: number
|
productId: number
|
||||||
variantId: number
|
variantId: number
|
||||||
@ -40,19 +38,19 @@ export type WishlistHandlers = {
|
|||||||
getWishlist: BigcommerceHandler<Wishlist, { customerToken?: string }>
|
getWishlist: BigcommerceHandler<Wishlist, { customerToken?: string }>
|
||||||
addWishlist: BigcommerceHandler<
|
addWishlist: BigcommerceHandler<
|
||||||
Wishlist,
|
Wishlist,
|
||||||
{ wishlistId: string } & Body<AddWishlistBody>
|
{ wishlistId: string } & Partial<AddWishlistBody>
|
||||||
>
|
>
|
||||||
updateWishlist: BigcommerceHandler<
|
updateWishlist: BigcommerceHandler<
|
||||||
Wishlist,
|
Wishlist,
|
||||||
{ wishlistId: string } & Body<AddWishlistBody>
|
{ wishlistId: string } & Partial<AddWishlistBody>
|
||||||
>
|
>
|
||||||
addItem: BigcommerceHandler<
|
addItem: BigcommerceHandler<
|
||||||
Wishlist,
|
Wishlist,
|
||||||
{ customerToken?: string } & Body<AddItemBody>
|
{ customerToken?: string } & Partial<AddItemBody>
|
||||||
>
|
>
|
||||||
removeItem: BigcommerceHandler<
|
removeItem: BigcommerceHandler<
|
||||||
Wishlist,
|
Wishlist,
|
||||||
{ customerToken?: string } & Body<RemoveItemBody>
|
{ customerToken?: string } & Partial<RemoveItemBody>
|
||||||
>
|
>
|
||||||
removeWishlist: BigcommerceHandler<Wishlist, { wishlistId: string }>
|
removeWishlist: BigcommerceHandler<Wishlist, { wishlistId: string }>
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user