feat: Update signature of region module to match latest spec (#6487)
This commit is contained in:
1 parent
c86e27bd0d
commit
5b85c3103e
8 files changed
+174
-87
No files matched your search
@@ -2,14 +2,14 @@ import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||
import {
|
||||
FilterableRegionProps,
|
||||
IRegionModuleService,
|
||||
UpdatableRegionFields,
|
||||
UpdateRegionDTO,
|
||||
} from "@medusajs/types"
|
||||
import { getSelectsAndRelationsFromObjectArray } from "@medusajs/utils"
|
||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
||||
|
||||
type UpdateRegionsStepInput = {
|
||||
selector: FilterableRegionProps
|
||||
update: UpdatableRegionFields
|
||||
update: UpdateRegionDTO
|
||||
}
|
||||
|
||||
export const updateRegionsStepId = "update-region"
|
||||
@@ -42,7 +42,7 @@ export const updateRegionsStep = createStep(
|
||||
ModuleRegistrationName.REGION
|
||||
)
|
||||
|
||||
await service.update(
|
||||
await service.upsert(
|
||||
prevData.map((r) => ({
|
||||
id: r.id,
|
||||
name: r.name,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import {
|
||||
FilterableRegionProps,
|
||||
RegionDTO,
|
||||
UpdatableRegionFields,
|
||||
UpdateRegionDTO,
|
||||
} from "@medusajs/types"
|
||||
import { WorkflowData, createWorkflow } from "@medusajs/workflows-sdk"
|
||||
import { updateRegionsStep } from "../steps"
|
||||
|
||||
type UpdateRegionsStepInput = {
|
||||
selector: FilterableRegionProps
|
||||
update: UpdatableRegionFields
|
||||
update: UpdateRegionDTO
|
||||
}
|
||||
|
||||
type WorkflowInput = UpdateRegionsStepInput
|
||||
|
||||
Reference in new issue
Block a user