When trying to send a request to the server and check the response, I am not seeing any results. The code for sending the request is below:
SendVerificationInfo(item: SendVerificationModel): Observable < any > {
return this.httpClient.post < any > (this.appConfig.apiEndpoint + '/Account/VerifyAccount', item);
}
In the component, I have written the following code to process the server response:
ngOnInit(): void {
this.SendData(this.sendModel);
}
SendData(sendModel): void {
console.log('in')
this.authService.SendVerificationInfo(sendModel).subscribe(data => {
console.log(data)
if (data['success']) {
this.router.navigate(['/verified-success'])
} else {
console.log('in else ')
this.router.navigate(['/invalid-token'])
}
})
}
What could be causing this problem? How can it be resolved?