feat(store-home-page): refactor to use catalog structure and update product loading logic
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';
|
||||
|
||||
import { ApiPaginatedResponse } from '../../../core/services/api-paginated-response.interface';
|
||||
import {
|
||||
CatalogFeaturedItem,
|
||||
CatalogFeaturedItemVariant,
|
||||
CatalogProductLayout,
|
||||
} from '../../../core/services/catalog/catalog.interface';
|
||||
import { PaginatorComponent } from '../paginator/paginator.component';
|
||||
import { ProductColumnWithImageComponent } from '../product-column-with-image/product-column-with-image.component';
|
||||
import {
|
||||
@@ -9,23 +14,9 @@ import {
|
||||
} from '../product-row-card/product-row-card.component';
|
||||
import { ProductVerticalWithCartCardComponent } from '../product-vertical-with-cart-card/product-vertical-with-cart-card.component';
|
||||
|
||||
export type ProductListLayout = 'row' | 'column_with_image' | 'column_with_cart';
|
||||
|
||||
export interface ProductListVariant {
|
||||
id: number;
|
||||
stock_tecnico: number | null;
|
||||
values: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface ProductListItem {
|
||||
id: number;
|
||||
nombre: string;
|
||||
descripcion?: string | null;
|
||||
precio: number | string;
|
||||
image?: string | null;
|
||||
stock_tecnico?: number | null;
|
||||
variants?: ProductListVariant[];
|
||||
}
|
||||
export type ProductListLayout = CatalogProductLayout;
|
||||
export type ProductListVariant = CatalogFeaturedItemVariant;
|
||||
export type ProductListItem = CatalogFeaturedItem;
|
||||
|
||||
export interface ProductListCartEvent {
|
||||
product: ProductListItem;
|
||||
|
||||
Reference in New Issue
Block a user