@infrab4a/connect-angular 5.2.2-beta.0 → 5.2.2-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2284,10 +2284,11 @@ __decorate([
2284
2284
  ], CategoryWithTree.prototype, "children", void 0);
2285
2285
 
2286
2286
  class WishlistService {
2287
- constructor(wishlistRepository, shop, logRepository) {
2287
+ constructor(wishlistRepository, productRepository, logRepository, shop) {
2288
2288
  this.wishlistRepository = wishlistRepository;
2289
- this.shop = shop;
2289
+ this.productRepository = productRepository;
2290
2290
  this.logRepository = logRepository;
2291
+ this.shop = shop;
2291
2292
  }
2292
2293
  initializeServices(catalogServiceFacade, categoryServiceFacade) {
2293
2294
  this.catalogService = catalogServiceFacade.getCatalogService();
@@ -2436,12 +2437,7 @@ class WishlistService {
2436
2437
  .then((res) => res.data.at(0));
2437
2438
  }
2438
2439
  async findProductById(id) {
2439
- if (!this.catalogService) {
2440
- throw new Error('CatalogService not initialized. Call initializeServices first.');
2441
- }
2442
- const helpersService = this.catalogService['helpersService'];
2443
- const productServices = helpersService.getProductServices();
2444
- return productServices.productRepository
2440
+ return this.productRepository
2445
2441
  .find({
2446
2442
  fields: ['id', 'sku', 'EAN', 'name', 'brand'],
2447
2443
  filters: {
@@ -2518,19 +2514,22 @@ class WishlistService {
2518
2514
  };
2519
2515
  }
2520
2516
  }
2521
- WishlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: DEFAULT_SHOP }, { token: 'LogRepository' }], target: i0.ɵɵFactoryTarget.Injectable });
2517
+ WishlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: 'ProductRepository' }, { token: 'LogRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable });
2522
2518
  WishlistService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService });
2523
2519
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, decorators: [{
2524
2520
  type: Injectable
2525
2521
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2526
2522
  type: Inject,
2527
2523
  args: ['WishlistRepository']
2528
- }] }, { type: i3.Shops, decorators: [{
2524
+ }] }, { type: undefined, decorators: [{
2529
2525
  type: Inject,
2530
- args: [DEFAULT_SHOP]
2526
+ args: ['ProductRepository']
2531
2527
  }] }, { type: undefined, decorators: [{
2532
2528
  type: Inject,
2533
2529
  args: ['LogRepository']
2530
+ }] }, { type: i3.Shops, decorators: [{
2531
+ type: Inject,
2532
+ args: [DEFAULT_SHOP]
2534
2533
  }] }]; } });
2535
2534
 
2536
2535
  class CouponRepositoriesFacade {