feat: add CatalogService and ProductDetailPageComponent with initial unit tests
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user