docs: replace ModuleRegistrationName with Modules (#9142)
This commit is contained in:
@@ -127,7 +127,7 @@ To execute the workflow, invoke it passing the Medusa container as a parameter.
|
||||
type SubscriberArgs,
|
||||
} from "@medusajs/medusa"
|
||||
import myWorkflow from "../workflows/hello-world"
|
||||
import { ModuleRegistrationName } from "@medusajs/utils"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { IUserModuleService } from "@medusajs/types"
|
||||
|
||||
export default async function handleCustomerCreate({
|
||||
@@ -136,7 +136,7 @@ To execute the workflow, invoke it passing the Medusa container as a parameter.
|
||||
}: SubscriberArgs<{ id: string }>) {
|
||||
const userId = data.id
|
||||
const userModuleService: IUserModuleService = container.resolve(
|
||||
ModuleRegistrationName.USER
|
||||
Modules.USER
|
||||
)
|
||||
|
||||
const user = await userModuleService.retrieveUser(userId)
|
||||
@@ -231,7 +231,7 @@ export const highlights = [
|
||||
["12", "resolve", "Resolve the Product Module's main service."],
|
||||
[
|
||||
"12",
|
||||
"ModuleRegistrationName.PRODUCT",
|
||||
"Modules.PRODUCT",
|
||||
"The resource registration name imported from `@medusajs/utils`.",
|
||||
],
|
||||
]
|
||||
@@ -244,11 +244,11 @@ import {
|
||||
WorkflowResponse,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { IProductModuleService } from "@medusajs/types"
|
||||
import { ModuleRegistrationName } from "@medusajs/utils"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
|
||||
const step1 = createStep("step-1", async (_, context) => {
|
||||
const productModuleService: IProductModuleService =
|
||||
context.container.resolve(ModuleRegistrationName.PRODUCT)
|
||||
context.container.resolve(Modules.PRODUCT)
|
||||
|
||||
const [, count] = await productModuleService.listAndCountProducts()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user