Skip to content

Commit

Permalink
Improve error message details in checkout component
Browse files Browse the repository at this point in the history
Enhanced error handling by including specific error details from the server response when available. This change aims to provide more informative feedback to users encountering issues during the checkout process.
  • Loading branch information
Zerskk committed Dec 2, 2024
1 parent 4cac4e7 commit 5d4dd25
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion archigator/src/app/main/main.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {ParametersService} from "../services/parameters.service";
import {ActivatedRoute, Router} from "@angular/router";
import {first} from "rxjs/operators";
import {ApiQueueService} from "../services/apiqueue.service";
import {ApiService} from "../services/api.service";
import {Metadata} from "../shared/response";


@Component({
Expand All @@ -17,11 +19,14 @@ import {ApiQueueService} from "../services/apiqueue.service";

export class MainComponent implements OnInit{

hasMetadata: boolean = false;

constructor(private oauthService: OAuthService,
private parameterService: ParametersService,
private route: ActivatedRoute,
private router: Router,
private apiQueue: ApiQueueService)
private apiQueue: ApiQueueService,
private apiService: ApiService)
{
}

Expand Down Expand Up @@ -53,9 +58,28 @@ export class MainComponent implements OnInit{
this.router.navigate(["/welcome"])
}

this.loadMetadata();


}


loadMetadata() {
this.apiService.getMetadata().subscribe(
(metadata: Metadata) => {
if (metadata) {
// Handle the logic here if metadata is not null or undefined
this.hasMetadata = true;
}
},
(error) => {
console.error('Failed to load metadata:', error);
this.hasMetadata = false;
}
);
}


async login(){

// const queryParams = this.route.snapshot.queryParams;
Expand Down

0 comments on commit 5d4dd25

Please sign in to comment.