chore(): Allow to register modules through array (#9522)

This commit is contained in:
Adrien de Peretti
2024-10-11 15:17:00 +02:00
committed by GitHub
parent 9c73503084
commit 1d8939df3a
35 changed files with 954 additions and 349 deletions
@@ -1,6 +1,6 @@
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
import { ContainerRegistrationKeys, Modules } from "@medusajs/framework/utils"
export const attachInventoryItemToVariantsStepId =
"attach-inventory-items-to-variants-step"
@@ -21,10 +21,10 @@ export const attachInventoryItemToVariants = createStep(
const linkDefinitions = input
.filter(({ tag }) => !!tag)
.map(({ inventoryItemId, tag }) => ({
Product: {
[Modules.PRODUCT]: {
variant_id: tag!,
},
Inventory: {
[Modules.INVENTORY]: {
inventory_item_id: inventoryItemId,
},
}))