Skip to main content
Skip to main content

updateRuleTypes - Pricing Module Reference

Beta

This 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

dataUpdateRuleTypeDTO[]Required
The rule types to update, each having the attributes that should be updated in a rule type.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<RuleTypeDTO[]>Required
The list of updated rule types.
Was this section helpful?