feat: add CatalogService and ProductDetailPageComponent with initial unit tests

This commit is contained in:
2026-07-01 11:16:19 -03:00
parent 3ad29f959d
commit ae0690a6f4
3 changed files with 15 additions and 44 deletions

View File

@@ -35,14 +35,9 @@ export class CatalogService {
);
}
getProducto(id: number, defaultVariantId?: number): Observable<ProductDetail> {
const params =
defaultVariantId === undefined
? undefined
: new HttpParams({ fromObject: { default_variant: defaultVariantId } });
getProducto(id: number): Observable<ProductDetail> {
return this.http
.get<ApiResponse<ProductDetail>>(`${this.tenantApiUrl}/productos/${id}`, { params })
.get<ApiResponse<ProductDetail>>(`${this.tenantApiUrl}/productos/${id}`)
.pipe(map((response) => response.data));
}