diff --git a/src/app/services/services.component.html b/src/app/services/services.component.html index 2ae7417..cfdf416 100644 --- a/src/app/services/services.component.html +++ b/src/app/services/services.component.html @@ -36,7 +36,7 @@ diff --git a/src/app/services/services.component.ts b/src/app/services/services.component.ts index e7a1cfb..29ecb20 100644 --- a/src/app/services/services.component.ts +++ b/src/app/services/services.component.ts @@ -5,7 +5,6 @@ import {Title} from '@angular/platform-browser'; import {isPlatformBrowser, NgIf, NgFor, NgStyle} from '@angular/common'; import {TranslatePipe, TranslateService} from '@ngx-translate/core'; import {HttpClient} from '@angular/common/http'; -import {Observable, tap} from 'rxjs'; @Component({ selector: 'app-services', @@ -154,16 +153,17 @@ export class ServicesComponent implements OnInit, OnDestroy, AfterViewInit { this.vantaService.resizeVanta(this.elementId); } - checkout(priceId: string): Observable { - return this.http.post(this.apiUrl, { priceId }).pipe( - tap((response) => { + checkout(priceId: string): void { + this.http.post(this.apiUrl, { priceId }).subscribe({ + next: (response) => { if (response.url) { window.location.href = response.url; } else { alert('Checkout session failed.'); } - }) - ); + }, + error: () => alert('Checkout session failed.') + }); } getActivePriceId(service: any, activeTab: string): string | null {