fix: Skip migration if module is not installed (#12507)
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
|||||||
createShippingProfilesStep,
|
createShippingProfilesStep,
|
||||||
useQueryGraphStep,
|
useQueryGraphStep,
|
||||||
} from "@medusajs/core-flows"
|
} from "@medusajs/core-flows"
|
||||||
|
import { MedusaModule } from "@medusajs/framework/modules-sdk"
|
||||||
import { ExecArgs } from "@medusajs/framework/types"
|
import { ExecArgs } from "@medusajs/framework/types"
|
||||||
import { ContainerRegistrationKeys, Modules } from "@medusajs/framework/utils"
|
import { ContainerRegistrationKeys, Modules } from "@medusajs/framework/utils"
|
||||||
import {
|
import {
|
||||||
@@ -73,6 +74,13 @@ const assignProductsToShippingProfileWorkflow = createWorkflow(
|
|||||||
export default async function assignProductsToShippingProfile({
|
export default async function assignProductsToShippingProfile({
|
||||||
container,
|
container,
|
||||||
}: ExecArgs) {
|
}: ExecArgs) {
|
||||||
|
if (
|
||||||
|
!MedusaModule.isInstalled(Modules.FULFILLMENT) ||
|
||||||
|
!MedusaModule.isInstalled(Modules.PRODUCT)
|
||||||
|
) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const logger = container.resolve(ContainerRegistrationKeys.LOGGER)
|
const logger = container.resolve(ContainerRegistrationKeys.LOGGER)
|
||||||
|
|
||||||
logger.info("Assigning products to shipping profile")
|
logger.info("Assigning products to shipping profile")
|
||||||
|
|||||||
Reference in New Issue
Block a user