updateRegions - Region Module Reference

This documentation provides a reference to the updateRegions method. This belongs to the Region Module.

NoteYou should only use this methods when implementing complex customizations. For common cases, check out available workflows instead.

updateRegions(id, data, sharedContext?): Promise<RegionDTO>#

This method updates an existing region.

Example#

Code
1const region = await regionModuleService.updateRegions("reg_123", {2  automatic_taxes: false,3})

Parameters#

idstring
The ID of the region.
The attributes to update in the region.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<RegionDTO>
The updated region.

updateRegions(selector, data, sharedContext?): Promise<RegionDTO[]>#

This method updates existing regions.

Example#

Code
1const region = await regionModuleService.updateRegions(2  {3    name: "Europe",4  },5  {6    automatic_taxes: false,7  }8)

Parameters#

The filters to apply on the retrieved regions.
The attributes to update in the region.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<RegionDTO[]>
The updated regions.
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break