diff --git a/src/app/features/store/pages/checkout-page/checkout-page.component.ts b/src/app/features/store/pages/checkout-page/checkout-page.component.ts index e8647b7..197b53e 100644 --- a/src/app/features/store/pages/checkout-page/checkout-page.component.ts +++ b/src/app/features/store/pages/checkout-page/checkout-page.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, computed, inject, signal, ViewChild } from '@angular/core'; +import { ChangeDetectionStrategy, Component, computed, inject, OnInit, signal, ViewChild } from '@angular/core'; import { FormBuilder, Validators } from '@angular/forms'; import { Router } from '@angular/router'; import { startWith } from 'rxjs'; @@ -30,7 +30,7 @@ import { CheckoutForm, PaymentMethod, PaymentMethodOption, TransferAccount, Tran styleUrl: './checkout-page.component.scss', changeDetection: ChangeDetectionStrategy.OnPush }) -export class CheckoutPageComponent { +export class CheckoutPageComponent implements OnInit { private readonly formBuilder = inject(FormBuilder); private readonly cartService = inject(CartService); private readonly router = inject(Router); @@ -100,6 +100,10 @@ export class CheckoutPageComponent { } } + ngOnInit(): void { + this.cartService.loadCart().subscribe(); + } + private mapCartItemToMock(item: CartItem): CartItemMock { const fullName = item.product?.nombre ?? ''; let product = fullName;