Skip to main content
Skip to main content

updateCategory - Product Module Reference

Beta

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

This method is used to update a product category by its ID.

Example

import {
initialize as initializeProductModule,
} from "@medusajs/product"

async function updateCategory (id: string, name: string) {
const productModule = await initializeProductModule()

const category = await productModule.updateCategory(id, {
name,
})

// do something with the product category or return it
}

Parameters

categoryIdstringRequired
The ID of the product category to update.
The attributes to update in th product category.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<ProductCategoryDTO>Required
The updated product category.
Was this section helpful?