fix(index): preserve existing fields configuration (#13639) (#13640)

Co-authored-by: William Bouchard <46496014+willbouch@users.noreply.github.com>
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
This commit is contained in:
martinerko
2025-10-02 19:53:56 +10:00
committed by GitHub
parent 02b6d01382
commit 9361f9c25a
2 changed files with 8 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/index": patch
---
fix(index): preserve existing fields configuration (#13639)

View File

@@ -845,7 +845,9 @@ function processEntity(
]
intermediateEntityObjectRepresentationRef.moduleConfig =
intermediateEntityModule
intermediateEntityObjectRepresentationRef.fields = ["id"]
if (!intermediateEntityObjectRepresentationRef.fields.includes("id")) {
intermediateEntityObjectRepresentationRef.fields.push("id")
}
/**
* We push the parent id only between intermediate entities but not between intermediate and link