fix(product): Category repository missing ontext (#9688)
**What** - Fix product category repository missing context passed to down level methods - Ensure the base repository when getting the active manager returns a fresh one if possible instead of the global one in order to prevent shared entity map by mistake
This commit is contained in:
@@ -6,9 +6,9 @@ import {
|
||||
} from "@medusajs/framework/types"
|
||||
import { DALUtils, isDefined, MedusaError } from "@medusajs/framework/utils"
|
||||
import {
|
||||
LoadStrategy,
|
||||
FilterQuery as MikroFilterQuery,
|
||||
FindOptions as MikroOptions,
|
||||
LoadStrategy,
|
||||
} from "@mikro-orm/core"
|
||||
import { SqlEntityManager } from "@mikro-orm/postgresql"
|
||||
import { ProductCategory } from "@models"
|
||||
@@ -93,7 +93,8 @@ export class ProductCategoryRepository extends DALUtils.MikroOrmBaseTreeReposito
|
||||
ancestors: transformOptions.includeAncestorsTree,
|
||||
},
|
||||
productCategories,
|
||||
findOptions_
|
||||
findOptions_,
|
||||
context
|
||||
)
|
||||
|
||||
return this.sortCategoriesByRank(categoriesTree)
|
||||
@@ -250,7 +251,8 @@ export class ProductCategoryRepository extends DALUtils.MikroOrmBaseTreeReposito
|
||||
ancestors: transformOptions.includeAncestorsTree,
|
||||
},
|
||||
productCategories,
|
||||
findOptions_
|
||||
findOptions_,
|
||||
context
|
||||
)
|
||||
|
||||
return [this.sortCategoriesByRank(categoriesTree), count]
|
||||
|
||||
Reference in New Issue
Block a user