Procházet zdrojové kódy

fix(elasticsearch-plugin): :bug: Fix relation on customfields for products and variants

giosue.delgado před 2 roky
rodič
revize
77c10f24ac

+ 3 - 4
packages/elasticsearch-plugin/src/indexing/indexer.controller.ts

@@ -502,8 +502,7 @@ export class ElasticsearchIndexerController implements OnModuleInit, OnModuleDes
         let product: Product | undefined;
         try {
             product = await this.connection
-                .rawConnection
-                .getRepository(Product)
+                .getRepository(ctx, Product)
                 .find({
                     relationLoadStrategy: 'query',
                     where: {id: productId, deletedAt: IsNull()},
@@ -516,8 +515,8 @@ export class ElasticsearchIndexerController implements OnModuleInit, OnModuleDes
         }
         if (!product)
             return;
-
-        const updatedProductVariants = await this.connection.rawConnection.getRepository(ProductVariant).find({
+        
+        const updatedProductVariants = await this.connection.getRepository(ctx, ProductVariant).find({
             relations: this.variantRelations,
             where: {
                 productId,