mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 05:56:59 +00:00
feat(poc): fix cart type
This commit is contained in:
parent
ed9d1dd2a1
commit
ab2959fa15
@ -1,44 +1,44 @@
|
||||
import {
|
||||
requestCart,
|
||||
requestCategory,
|
||||
requestCategoryList,
|
||||
requestCategoryProductsCollection,
|
||||
requestCrossSell,
|
||||
requestNavigation,
|
||||
requestProductsCollection,
|
||||
requestSearchCollectionProducts,
|
||||
requestSeoUrl,
|
||||
requestSeoUrls
|
||||
requestCart,
|
||||
requestCategory,
|
||||
requestCategoryList,
|
||||
requestCategoryProductsCollection,
|
||||
requestCrossSell,
|
||||
requestNavigation,
|
||||
requestProductsCollection,
|
||||
requestSearchCollectionProducts,
|
||||
requestSeoUrl,
|
||||
requestSeoUrls
|
||||
} from './api';
|
||||
import { ExtendedCategory, ExtendedProduct, ExtendedProductListingResult } from './api-extended';
|
||||
import {
|
||||
getDefaultCategoryCriteria,
|
||||
getDefaultCategoryWithCmsCriteria,
|
||||
getDefaultCrossSellingCriteria,
|
||||
getDefaultProductCriteria,
|
||||
getDefaultProductsCriteria,
|
||||
getDefaultSearchProductsCriteria,
|
||||
getDefaultSubCategoriesCriteria,
|
||||
getSortingCriteria
|
||||
getDefaultCategoryCriteria,
|
||||
getDefaultCategoryWithCmsCriteria,
|
||||
getDefaultCrossSellingCriteria,
|
||||
getDefaultProductCriteria,
|
||||
getDefaultProductsCriteria,
|
||||
getDefaultSearchProductsCriteria,
|
||||
getDefaultSubCategoriesCriteria,
|
||||
getSortingCriteria
|
||||
} from './criteria';
|
||||
import {
|
||||
transformCollection,
|
||||
transformHandle,
|
||||
transformMenu,
|
||||
transformPage,
|
||||
transformProduct,
|
||||
transformProducts,
|
||||
transformSubCollection
|
||||
transformCollection,
|
||||
transformHandle,
|
||||
transformMenu,
|
||||
transformPage,
|
||||
transformProduct,
|
||||
transformProducts,
|
||||
transformSubCollection
|
||||
} from './transform';
|
||||
import {
|
||||
ApiSchemas,
|
||||
Cart,
|
||||
CategoryListingResultSW,
|
||||
Menu,
|
||||
Page,
|
||||
Product,
|
||||
ProductListingCriteria,
|
||||
StoreNavigationTypeSW
|
||||
ApiSchemas,
|
||||
Cart,
|
||||
CategoryListingResultSW,
|
||||
Menu,
|
||||
Page,
|
||||
Product,
|
||||
ProductListingCriteria,
|
||||
StoreNavigationTypeSW
|
||||
} from './types';
|
||||
|
||||
export async function getMenu(params?: {
|
||||
@ -280,9 +280,8 @@ export async function getCart(): Promise<Cart> {
|
||||
id: cartData.token || '',
|
||||
lines:
|
||||
cartData.lineItems?.map((lineItem) => ({
|
||||
id: lineItem.id || '',
|
||||
quantity: lineItem.quantity ?? 0,
|
||||
id: lineItem.referencedId || '',
|
||||
quantity: lineItem.quantity ?? 0,
|
||||
cost: {
|
||||
totalAmount: {
|
||||
amount: (lineItem as any)?.price?.totalPrice || '',
|
||||
|
Loading…
x
Reference in New Issue
Block a user