mirror of
https://github.com/vercel/commerce.git
synced 2025-07-04 12:11:22 +00:00
* folder and env setup * codegen.json headers removed * use-cart code flow updated * use-cart code flow updated * Implemented get-cart functionality * removed unused file * getAnonymousShopperToken function added * normalization mapping updated * PR points resolved * Anonymous shopper token query added * getAnonymousShopperToken function added * Anonymous shopper token query added Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>
27 lines
699 B
TypeScript
27 lines
699 B
TypeScript
import { GetAPISchema, createEndpoint } from '@commerce/api'
|
|
import cartEndpoint from '@commerce/api/endpoints/cart'
|
|
// import type { CartSchema } from '../../../types/cart'
|
|
import type { KiboCommerceAPI } from '../..'
|
|
import getCart from './get-cart'
|
|
// import addItem from './add-item'
|
|
// import updateItem from './update-item'
|
|
// import removeItem from './remove-item'
|
|
|
|
export type CartAPI = GetAPISchema<KiboCommerceAPI, any>
|
|
|
|
export type CartEndpoint = CartAPI['endpoint']
|
|
|
|
export const handlers: CartEndpoint['handlers'] = {
|
|
getCart,
|
|
// addItem,
|
|
// updateItem,
|
|
// removeItem,
|
|
}
|
|
|
|
const cartApi = createEndpoint<CartAPI>({
|
|
handler: cartEndpoint,
|
|
handlers,
|
|
})
|
|
|
|
export default cartApi
|