Route marketplace data through product facade
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { Component, OnInit, OnDestroy, signal, computed, ChangeDetectionStrategy } from '@angular/core';
|
||||
import { Router, RouterLink } from '@angular/router';
|
||||
import { ApiService, LanguageService } from '../../services';
|
||||
import { LanguageService } from '../../services';
|
||||
import { Category } from '../../models';
|
||||
import { getTranslatedCategoryName } from '../../utils/item.utils';
|
||||
import { ItemsCarouselComponent } from '../../components/items-carousel/items-carousel.component';
|
||||
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
||||
import { TranslatePipe } from '../../i18n/translate.pipe';
|
||||
import { UiRuntimeFacade } from '../../facades/runtime/ui-runtime.facade';
|
||||
import { ProductFacade } from '../../facades/platform/product.facade';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
@@ -17,10 +18,10 @@ import { UiRuntimeFacade } from '../../facades/runtime/ui-runtime.facade';
|
||||
})
|
||||
export class HomeComponent implements OnInit, OnDestroy {
|
||||
constructor(
|
||||
private apiService: ApiService,
|
||||
private router: Router,
|
||||
private langService: LanguageService,
|
||||
private readonly uiRuntime: UiRuntimeFacade
|
||||
private readonly uiRuntime: UiRuntimeFacade,
|
||||
private readonly productFacade: ProductFacade
|
||||
) {}
|
||||
|
||||
categories = signal<Category[]>([]);
|
||||
@@ -80,7 +81,7 @@ export class HomeComponent implements OnInit, OnDestroy {
|
||||
|
||||
loadCategories(): void {
|
||||
this.loading.set(true);
|
||||
this.apiService.getCategories().subscribe({
|
||||
this.productFacade.getCategories().subscribe({
|
||||
next: (categories) => {
|
||||
this.categories.set(categories);
|
||||
this.loading.set(false);
|
||||
|
||||
Reference in New Issue
Block a user