Skip to main content
Skip to main content

update - Product Module Reference

This documentation provides a reference to the update method. This belongs to the Product Module.

update(id, data, sharedContext?): Promise<ProductDTO>

This method is used to update a product.

Example

const product = await productModuleService.update(
"prod_123",
{
handle: "pant",
}
)

Parameters

idstringRequired
The ID of the product to be updated.
dataUpdateProductDTORequired
The attributes of the product to be updated
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<ProductDTO>Required
The updated product.

update(selector, data, sharedContext?): Promise<ProductDTO[]>

This method is used to update a list of products matching the specified filters.

Example

const products = await productModuleService.update(
{
title: "Pant",
},
{
handle: "pant",
}
)

Parameters

selectorFilterableProductPropsRequired
The filters specifying which products to update.
dataUpdateProductDTORequired
The attributes to be updated on the selected products
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<ProductDTO[]>Required
The updated products.
Was this section helpful?