updateRuleTypes - Pricing Module Reference
BetaThis documentation provides a reference to the updateRuleTypes method. This belongs to the Pricing Module.
This method is used to update existing rule types with the provided data.
Example
import {
  initialize as initializePricingModule,
} from "@medusajs/pricing"
async function updateRuleTypes (ruleTypeId: string) {
  const pricingService = await initializePricingModule()
  const ruleTypes = await pricingService.updateRuleTypes([
    {
      id: ruleTypeId,
      name: "Region",
    }
  ])
  // do something with the rule types or return them
}
Parameters
The rule types to update, each having the attributes that should be updated in a rule type.
sharedContextContextA context used to share resources, such as transaction manager, between the application and the module.
sharedContextContextReturns
The list of updated rule types.
Was this section helpful?