chore(): Improve cart update line items (#11666)
**What** Currently, we are potentially providing an array of selector/data leading to fetching data sequentially before running on update which will fetch data again in batch and perform the update. Now we can pass the data directly which includes the id already and only perform one bulk fetch + one bulk update. This pr also include a fix on the inventory validation, currently, only the item to update inventory is being checked, with this pr we also check the inventory for the items that needs to be created
This commit is contained in:
1 parent
39597b6b52
commit
d1efad9bf0
10 files changed
+188
-60
No files matched your search
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/cart": patch
|
||||||
|
"@medusajs/core-flows": patch
|
||||||
|
"@medusajs/types": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
chore(): Improve cart update line items
|
||||||
@@ -2,6 +2,7 @@ import {
|
|||||||
CartLineItemDTO,
|
CartLineItemDTO,
|
||||||
CreateLineItemForCartDTO,
|
CreateLineItemForCartDTO,
|
||||||
ICartModuleService,
|
ICartModuleService,
|
||||||
|
UpdateLineItemWithoutSelectorDTO,
|
||||||
UpdateLineItemWithSelectorDTO,
|
UpdateLineItemWithSelectorDTO,
|
||||||
} from "@medusajs/framework/types"
|
} from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
@@ -34,7 +35,9 @@ export interface GetLineItemActionsStepOutput {
|
|||||||
/**
|
/**
|
||||||
* The line items to update.
|
* The line items to update.
|
||||||
*/
|
*/
|
||||||
itemsToUpdate: UpdateLineItemWithSelectorDTO[]
|
itemsToUpdate:
|
||||||
|
| UpdateLineItemWithSelectorDTO[]
|
||||||
|
| UpdateLineItemWithoutSelectorDTO[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getLineItemActionsStepId = "get-line-item-actions-step"
|
export const getLineItemActionsStepId = "get-line-item-actions-step"
|
||||||
@@ -63,17 +66,29 @@ export const getLineItemActionsStep = createStep(
|
|||||||
const cartModule = container.resolve<ICartModuleService>(Modules.CART)
|
const cartModule = container.resolve<ICartModuleService>(Modules.CART)
|
||||||
|
|
||||||
const variantIds = data.items.map((d) => d.variant_id!)
|
const variantIds = data.items.map((d) => d.variant_id!)
|
||||||
const existingVariantItems = await cartModule.listLineItems({
|
const existingVariantItems = await cartModule.listLineItems(
|
||||||
cart_id: data.id,
|
{
|
||||||
variant_id: variantIds,
|
cart_id: data.id,
|
||||||
})
|
variant_id: variantIds,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
select: [
|
||||||
|
"id",
|
||||||
|
"metadata",
|
||||||
|
"variant_id",
|
||||||
|
"quantity",
|
||||||
|
"unit_price",
|
||||||
|
"compare_at_unit_price",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
const variantItemMap = new Map<string, CartLineItemDTO>(
|
const variantItemMap = new Map<string, CartLineItemDTO>(
|
||||||
existingVariantItems.map((item) => [item.variant_id!, item])
|
existingVariantItems.map((item) => [item.variant_id!, item])
|
||||||
)
|
)
|
||||||
|
|
||||||
const itemsToCreate: CreateLineItemForCartDTO[] = []
|
const itemsToCreate: CreateLineItemForCartDTO[] = []
|
||||||
const itemsToUpdate: UpdateLineItemWithSelectorDTO[] = []
|
const itemsToUpdate: UpdateLineItemWithSelectorDTO["data"][] = []
|
||||||
|
|
||||||
for (const item of data.items) {
|
for (const item of data.items) {
|
||||||
const existingItem = variantItemMap.get(item.variant_id!)
|
const existingItem = variantItemMap.get(item.variant_id!)
|
||||||
@@ -88,15 +103,12 @@ export const getLineItemActionsStep = createStep(
|
|||||||
)
|
)
|
||||||
|
|
||||||
itemsToUpdate.push({
|
itemsToUpdate.push({
|
||||||
selector: { id: existingItem.id },
|
id: existingItem.id,
|
||||||
data: {
|
quantity: quantity,
|
||||||
id: existingItem.id,
|
variant_id: item.variant_id!,
|
||||||
quantity: quantity,
|
unit_price: item.unit_price ?? existingItem.unit_price,
|
||||||
variant_id: item.variant_id!,
|
compare_at_unit_price:
|
||||||
unit_price: item.unit_price ?? existingItem.unit_price,
|
item.compare_at_unit_price ?? existingItem.compare_at_unit_price,
|
||||||
compare_at_unit_price:
|
|
||||||
item.compare_at_unit_price ?? existingItem.compare_at_unit_price,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
itemsToCreate.push(item)
|
itemsToCreate.push(item)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
ICartModuleService,
|
ICartModuleService,
|
||||||
|
UpdateLineItemWithoutSelectorDTO,
|
||||||
UpdateLineItemWithSelectorDTO,
|
UpdateLineItemWithSelectorDTO,
|
||||||
} from "@medusajs/framework/types"
|
} from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
@@ -19,13 +20,13 @@ export interface UpdateLineItemsStepInput {
|
|||||||
/**
|
/**
|
||||||
* The line items to update.
|
* The line items to update.
|
||||||
*/
|
*/
|
||||||
items: UpdateLineItemWithSelectorDTO[]
|
items: (UpdateLineItemWithSelectorDTO | UpdateLineItemWithoutSelectorDTO)[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const updateLineItemsStepId = "update-line-items-step"
|
export const updateLineItemsStepId = "update-line-items-step"
|
||||||
/**
|
/**
|
||||||
* This step updates a cart's line items.
|
* This step updates a cart's line items.
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* const data = updateLineItemsStep({
|
* const data = updateLineItemsStep({
|
||||||
* id: "cart_123",
|
* id: "cart_123",
|
||||||
@@ -53,16 +54,18 @@ export const updateLineItemsStep = createStep(
|
|||||||
const cartModule = container.resolve<ICartModuleService>(Modules.CART)
|
const cartModule = container.resolve<ICartModuleService>(Modules.CART)
|
||||||
|
|
||||||
const { selects, relations } = getSelectsAndRelationsFromObjectArray(
|
const { selects, relations } = getSelectsAndRelationsFromObjectArray(
|
||||||
items.map((item) => item.data)
|
items.map((item) => ("data" in item ? item.data : item))
|
||||||
)
|
)
|
||||||
|
|
||||||
const itemsBeforeUpdate = await cartModule.listLineItems(
|
const itemsBeforeUpdate = await cartModule.listLineItems(
|
||||||
{ id: items.map((d) => d.selector.id!) },
|
{ id: items.map((d) => ("selector" in d ? d.selector.id! : d.id!)) },
|
||||||
{ select: selects, relations }
|
{ select: selects, relations }
|
||||||
)
|
)
|
||||||
|
|
||||||
const updatedItems = items.length
|
const updatedItems = items.length
|
||||||
? await cartModule.updateLineItems(items)
|
? await cartModule.updateLineItems(
|
||||||
|
items as UpdateLineItemWithoutSelectorDTO[]
|
||||||
|
)
|
||||||
: []
|
: []
|
||||||
|
|
||||||
return new StepResponse(updatedItems, itemsBeforeUpdate)
|
return new StepResponse(updatedItems, itemsBeforeUpdate)
|
||||||
|
|||||||
@@ -51,11 +51,13 @@ export const prepareConfirmInventoryInput = (data: {
|
|||||||
const salesChannelId = data.input.sales_channel_id
|
const salesChannelId = data.input.sales_channel_id
|
||||||
|
|
||||||
for (const updateItem of data.input.itemsToUpdate ?? []) {
|
for (const updateItem of data.input.itemsToUpdate ?? []) {
|
||||||
|
const updateItem_ = "data" in updateItem ? updateItem.data : updateItem
|
||||||
|
|
||||||
const item = data.input.items.find(
|
const item = data.input.items.find(
|
||||||
(item) => item.variant_id === updateItem.data.variant_id
|
(item) => item.variant_id === updateItem_.variant_id
|
||||||
)
|
)
|
||||||
if (item && updateItem.data.quantity) {
|
if (item && updateItem_.quantity) {
|
||||||
item.quantity = updateItem.data.quantity!
|
item.quantity = updateItem_.quantity!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import { AddToCartWorkflowInputDTO } from "@medusajs/framework/types"
|
import {
|
||||||
|
AddToCartWorkflowInputDTO,
|
||||||
|
ConfirmVariantInventoryWorkflowInputDTO,
|
||||||
|
} from "@medusajs/framework/types"
|
||||||
import { CartWorkflowEvents, isDefined } from "@medusajs/framework/utils"
|
import { CartWorkflowEvents, isDefined } from "@medusajs/framework/utils"
|
||||||
import {
|
import {
|
||||||
createHook,
|
createHook,
|
||||||
@@ -141,12 +144,32 @@ export const addToCartWorkflow = createWorkflow(
|
|||||||
items: lineItems,
|
items: lineItems,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const itemsToConfirmInventory = transform(
|
||||||
|
{ itemsToUpdate, itemsToCreate },
|
||||||
|
(data) => {
|
||||||
|
return (data.itemsToUpdate as [])
|
||||||
|
.concat(data.itemsToCreate as [])
|
||||||
|
.filter(
|
||||||
|
(
|
||||||
|
item:
|
||||||
|
| {
|
||||||
|
data: { variant_id: string }
|
||||||
|
}
|
||||||
|
| { variant_id?: string }
|
||||||
|
) =>
|
||||||
|
isDefined(
|
||||||
|
"data" in item ? item.data?.variant_id : item.variant_id
|
||||||
|
)
|
||||||
|
) as unknown as ConfirmVariantInventoryWorkflowInputDTO["itemsToUpdate"]
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
confirmVariantInventoryWorkflow.runAsStep({
|
confirmVariantInventoryWorkflow.runAsStep({
|
||||||
input: {
|
input: {
|
||||||
sales_channel_id: cart.sales_channel_id,
|
sales_channel_id: cart.sales_channel_id,
|
||||||
variants,
|
variants,
|
||||||
items: input.items,
|
items: input.items,
|
||||||
itemsToUpdate,
|
itemsToUpdate: itemsToConfirmInventory,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -618,6 +618,11 @@ export interface UpdateLineItemWithSelectorDTO {
|
|||||||
data: Partial<UpdateLineItemDTO>
|
data: Partial<UpdateLineItemDTO>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface UpdateLineItemWithoutSelectorDTO
|
||||||
|
extends Omit<Partial<UpdateLineItemDTO>, "id"> {
|
||||||
|
id: string
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A pair of selectors and data, where the selectors determine which
|
* A pair of selectors and data, where the selectors determine which
|
||||||
* carts to update, and the data determines what to update
|
* carts to update, and the data determines what to update
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import {
|
|||||||
UpdateCartDTO,
|
UpdateCartDTO,
|
||||||
UpdateLineItemDTO,
|
UpdateLineItemDTO,
|
||||||
UpdateLineItemTaxLineDTO,
|
UpdateLineItemTaxLineDTO,
|
||||||
|
UpdateLineItemWithoutSelectorDTO,
|
||||||
UpdateLineItemWithSelectorDTO,
|
UpdateLineItemWithSelectorDTO,
|
||||||
UpdateShippingMethodAdjustmentDTO,
|
UpdateShippingMethodAdjustmentDTO,
|
||||||
UpdateShippingMethodDTO,
|
UpdateShippingMethodDTO,
|
||||||
@@ -647,6 +648,25 @@ export interface ICartModuleService extends IModuleService {
|
|||||||
data: UpdateLineItemWithSelectorDTO[]
|
data: UpdateLineItemWithSelectorDTO[]
|
||||||
): Promise<CartLineItemDTO[]>
|
): Promise<CartLineItemDTO[]>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method updates existing line items.
|
||||||
|
*
|
||||||
|
* @param {UpdateLineItemWithoutSelectorDTO[]} data - A list of objects, each holding the data
|
||||||
|
* and id to update.
|
||||||
|
* @returns {Promise<CartLineItemDTO[]>} The updated line items.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* const lineItems = await cartModuleService.updateLineItems([
|
||||||
|
* {
|
||||||
|
* id: "cali_123",
|
||||||
|
* quantity: 2,
|
||||||
|
* },
|
||||||
|
* ])
|
||||||
|
*/
|
||||||
|
updateLineItems(
|
||||||
|
data: UpdateLineItemWithoutSelectorDTO[]
|
||||||
|
): Promise<CartLineItemDTO[]>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method updates existing line items matching the specified filters.
|
* This method updates existing line items matching the specified filters.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ export interface CreateCartCreateLineItemDTO {
|
|||||||
is_discountable?: boolean
|
is_discountable?: boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the line item's price is tax inclusive. Learn more in
|
* Whether the line item's price is tax inclusive. Learn more in
|
||||||
* [this documentation](https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing)
|
* [this documentation](https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing)
|
||||||
*/
|
*/
|
||||||
is_tax_inclusive?: boolean
|
is_tax_inclusive?: boolean
|
||||||
@@ -158,54 +158,54 @@ export interface CreateCartAddressDTO {
|
|||||||
* The first name of the customer associated with the address.
|
* The first name of the customer associated with the address.
|
||||||
*/
|
*/
|
||||||
first_name?: string
|
first_name?: string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The last name of the customer associated with the address.
|
* The last name of the customer associated with the address.
|
||||||
*/
|
*/
|
||||||
last_name?: string
|
last_name?: string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The address's phone number
|
* The address's phone number
|
||||||
*/
|
*/
|
||||||
phone?: string
|
phone?: string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The address's company name.
|
* The address's company name.
|
||||||
*/
|
*/
|
||||||
company?: string
|
company?: string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The primary address line.
|
* The primary address line.
|
||||||
*/
|
*/
|
||||||
address_1?: string
|
address_1?: string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The secondary address line.
|
* The secondary address line.
|
||||||
*/
|
*/
|
||||||
address_2?: string
|
address_2?: string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The city of the address.
|
* The city of the address.
|
||||||
*/
|
*/
|
||||||
city?: string
|
city?: string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The country code of the address.
|
* The country code of the address.
|
||||||
*
|
*
|
||||||
* @example us
|
* @example us
|
||||||
*/
|
*/
|
||||||
country_code?: string
|
country_code?: string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The province or state of the address.
|
* The province or state of the address.
|
||||||
*/
|
*/
|
||||||
province?: string
|
province?: string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The postal code of the address.
|
* The postal code of the address.
|
||||||
*/
|
*/
|
||||||
postal_code?: string
|
postal_code?: string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom key-value pairs related to the address.
|
* Custom key-value pairs related to the address.
|
||||||
*/
|
*/
|
||||||
@@ -238,7 +238,7 @@ export interface CreateCartWorkflowInputDTO {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The currency code of the cart. This defaults to the region's currency code.
|
* The currency code of the cart. This defaults to the region's currency code.
|
||||||
*
|
*
|
||||||
* @example usd
|
* @example usd
|
||||||
*/
|
*/
|
||||||
currency_code?: string
|
currency_code?: string
|
||||||
@@ -329,7 +329,7 @@ export interface UpdateCartWorkflowInputDTO {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The currency code for the cart.
|
* The currency code for the cart.
|
||||||
*
|
*
|
||||||
* @example usd
|
* @example usd
|
||||||
*/
|
*/
|
||||||
currency_code?: string
|
currency_code?: string
|
||||||
@@ -493,21 +493,32 @@ export interface ConfirmVariantInventoryWorkflowInputDTO {
|
|||||||
* The new quantity of the variant to be added to the cart.
|
* The new quantity of the variant to be added to the cart.
|
||||||
* This is useful when updating a variant's quantity in the cart.
|
* This is useful when updating a variant's quantity in the cart.
|
||||||
*/
|
*/
|
||||||
itemsToUpdate?: {
|
itemsToUpdate?:
|
||||||
/**
|
| {
|
||||||
* The item update's details.
|
/**
|
||||||
*/
|
* The item update's details.
|
||||||
data: {
|
*/
|
||||||
/**
|
data: {
|
||||||
* The ID of the associated variant.
|
/**
|
||||||
*/
|
* The ID of the associated variant.
|
||||||
variant_id?: string
|
*/
|
||||||
/**
|
variant_id?: string
|
||||||
* The variant's quantity.
|
/**
|
||||||
*/
|
* The variant's quantity.
|
||||||
quantity?: BigNumberInput
|
*/
|
||||||
}
|
quantity?: BigNumberInput
|
||||||
}[]
|
}
|
||||||
|
}[]
|
||||||
|
| {
|
||||||
|
/**
|
||||||
|
* The ID of the associated variant.
|
||||||
|
*/
|
||||||
|
variant_id?: string
|
||||||
|
/**
|
||||||
|
* The variant's quantity.
|
||||||
|
*/
|
||||||
|
quantity?: BigNumberInput
|
||||||
|
}[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CartWorkflowDTO {
|
export interface CartWorkflowDTO {
|
||||||
|
|||||||
@@ -676,6 +676,34 @@ moduleIntegrationTestRunner<ICartModuleService>({
|
|||||||
expect(updatedItem.title).toBe("test2")
|
expect(updatedItem.title).toBe("test2")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("should update a line item in cart succesfully with data only approach", async () => {
|
||||||
|
const [createdCart] = await service.createCarts([
|
||||||
|
{
|
||||||
|
currency_code: "eur",
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
|
const [item] = await service.addLineItems(createdCart.id, [
|
||||||
|
{
|
||||||
|
quantity: 1,
|
||||||
|
unit_price: 100,
|
||||||
|
title: "test",
|
||||||
|
tax_lines: [],
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
|
expect(item.title).toBe("test")
|
||||||
|
|
||||||
|
const [updatedItem] = await service.updateLineItems([
|
||||||
|
{
|
||||||
|
id: item.id,
|
||||||
|
title: "test2",
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
|
expect(updatedItem.title).toBe("test2")
|
||||||
|
})
|
||||||
|
|
||||||
it("should update a line item in cart succesfully with id approach", async () => {
|
it("should update a line item in cart succesfully with id approach", async () => {
|
||||||
const [createdCart] = await service.createCarts([
|
const [createdCart] = await service.createCarts([
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -489,6 +489,12 @@ export default class CartModuleService
|
|||||||
updateLineItems(
|
updateLineItems(
|
||||||
data: CartTypes.UpdateLineItemWithSelectorDTO[]
|
data: CartTypes.UpdateLineItemWithSelectorDTO[]
|
||||||
): Promise<CartTypes.CartLineItemDTO[]>
|
): Promise<CartTypes.CartLineItemDTO[]>
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
updateLineItems(
|
||||||
|
data: (Partial<CartTypes.UpdateLineItemDTO> & { id: string })[]
|
||||||
|
): Promise<CartTypes.CartLineItemDTO[]>
|
||||||
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
updateLineItems(
|
updateLineItems(
|
||||||
selector: Partial<CartTypes.CartLineItemDTO>,
|
selector: Partial<CartTypes.CartLineItemDTO>,
|
||||||
@@ -508,7 +514,8 @@ export default class CartModuleService
|
|||||||
lineItemIdOrDataOrSelector:
|
lineItemIdOrDataOrSelector:
|
||||||
| string
|
| string
|
||||||
| CartTypes.UpdateLineItemWithSelectorDTO[]
|
| CartTypes.UpdateLineItemWithSelectorDTO[]
|
||||||
| Partial<CartTypes.CartLineItemDTO>,
|
| Partial<CartTypes.CartLineItemDTO>
|
||||||
|
| (Partial<CartTypes.UpdateLineItemDTO> & { id: string })[],
|
||||||
data?: CartTypes.UpdateLineItemDTO | Partial<CartTypes.UpdateLineItemDTO>,
|
data?: CartTypes.UpdateLineItemDTO | Partial<CartTypes.UpdateLineItemDTO>,
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
): Promise<CartTypes.CartLineItemDTO[] | CartTypes.CartLineItemDTO> {
|
): Promise<CartTypes.CartLineItemDTO[] | CartTypes.CartLineItemDTO> {
|
||||||
@@ -521,10 +528,17 @@ export default class CartModuleService
|
|||||||
)
|
)
|
||||||
|
|
||||||
return await this.baseRepository_.serialize<CartTypes.CartLineItemDTO>(
|
return await this.baseRepository_.serialize<CartTypes.CartLineItemDTO>(
|
||||||
item,
|
item
|
||||||
{
|
)
|
||||||
populate: true,
|
} else if (Array.isArray(lineItemIdOrDataOrSelector) && !data) {
|
||||||
}
|
// We received an array of data including the ids
|
||||||
|
const items = await this.lineItemService_.update(
|
||||||
|
lineItemIdOrDataOrSelector,
|
||||||
|
sharedContext
|
||||||
|
)
|
||||||
|
|
||||||
|
return await this.baseRepository_.serialize<CartTypes.CartLineItemDTO[]>(
|
||||||
|
items
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -537,7 +551,10 @@ export default class CartModuleService
|
|||||||
} as CartTypes.UpdateLineItemWithSelectorDTO,
|
} as CartTypes.UpdateLineItemWithSelectorDTO,
|
||||||
]
|
]
|
||||||
|
|
||||||
items = await this.updateLineItemsWithSelector_(toUpdate, sharedContext)
|
items = await this.updateLineItemsWithSelector_(
|
||||||
|
toUpdate as CartTypes.UpdateLineItemWithSelectorDTO[],
|
||||||
|
sharedContext
|
||||||
|
)
|
||||||
|
|
||||||
return await this.baseRepository_.serialize<CartTypes.CartLineItemDTO[]>(
|
return await this.baseRepository_.serialize<CartTypes.CartLineItemDTO[]>(
|
||||||
items,
|
items,
|
||||||
|
|||||||
Reference in new issue
Block a user