fix(link-modules): Fix link module initialization (#4990)
**What** Add a new configuration on the relationship to specify if the relation is consumed from an internal service (from medusa core). In that case do not check if the service is part of the loaded modules
This commit is contained in:
1 parent
d971d5cf91
commit
a87d07655b
5 files changed
+18
-5
No files matched your search
@@ -1,3 +1,4 @@
|
||||
export * from "./inventory-level-stock-location"
|
||||
export * from "./product-variant-inventory-item"
|
||||
export * from "./product-variant-money-amount"
|
||||
export * from "./product-shipping-profile"
|
||||
@@ -24,9 +24,10 @@ export const ProductShippingProfile: ModuleJoinerConfig = {
|
||||
},
|
||||
{
|
||||
serviceName: "shippingProfileService",
|
||||
isInternalService: true,
|
||||
primaryKey: "id",
|
||||
foreignKey: "profile_id",
|
||||
alias: "shipping_profile",
|
||||
alias: "profile",
|
||||
},
|
||||
],
|
||||
extends: [
|
||||
|
||||
@@ -90,8 +90,10 @@ export const initialize = async (
|
||||
continue
|
||||
}
|
||||
} else if (
|
||||
!modulesLoadedKeys.includes(primary.serviceName) ||
|
||||
!modulesLoadedKeys.includes(foreign.serviceName)
|
||||
(!primary.isInternalService &&
|
||||
!modulesLoadedKeys.includes(primary.serviceName)) ||
|
||||
(!foreign.isInternalService &&
|
||||
!modulesLoadedKeys.includes(foreign.serviceName))
|
||||
) {
|
||||
continue
|
||||
}
|
||||
@@ -176,8 +178,10 @@ export async function runMigrations(
|
||||
allLinks.add(serviceKey)
|
||||
|
||||
if (
|
||||
!modulesLoadedKeys.includes(primary.serviceName) ||
|
||||
!modulesLoadedKeys.includes(foreign.serviceName)
|
||||
(!primary.isInternalService &&
|
||||
!modulesLoadedKeys.includes(primary.serviceName)) ||
|
||||
(!foreign.isInternalService &&
|
||||
!modulesLoadedKeys.includes(foreign.serviceName))
|
||||
) {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user