feat(medusa,orchestration): Decouple Product in Cart domain (#4945)
This commit is contained in:
committed by
GitHub
parent
1958809fa9
commit
4b0e3fb2a7
@@ -557,14 +557,15 @@ export class RemoteJoiner {
|
||||
parsedExpands: Map<string, RemoteExpandProperty>
|
||||
): Map<string, RemoteExpandProperty> {
|
||||
const mergedExpands = new Map<string, RemoteExpandProperty>(parsedExpands)
|
||||
const mergedPaths = new Map<string, string>()
|
||||
const mergedPaths = new Map<string, RemoteExpandProperty>()
|
||||
|
||||
for (const [path, expand] of mergedExpands.entries()) {
|
||||
const currentServiceName = expand.serviceConfig.serviceName
|
||||
let parentPath = expand.parent
|
||||
|
||||
while (parentPath) {
|
||||
const parentExpand = mergedExpands.get(parentPath)
|
||||
const parentExpand =
|
||||
mergedExpands.get(parentPath) ?? mergedPaths.get(parentPath)
|
||||
if (
|
||||
!parentExpand ||
|
||||
parentExpand.serviceConfig.serviceName !== currentServiceName
|
||||
@@ -588,7 +589,7 @@ export class RemoteJoiner {
|
||||
targetExpand.args = expand.args
|
||||
|
||||
mergedExpands.delete(path)
|
||||
mergedPaths.set(path, parentPath)
|
||||
mergedPaths.set(path, expand)
|
||||
|
||||
parentPath = parentExpand.parent
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user