modification messageService

This commit is contained in:
MiharyR 2021-12-04 11:09:37 +01:00
parent 819d266601
commit 6444df567b
4 changed files with 56 additions and 30 deletions

View file

@ -42,12 +42,29 @@ export class PageLoginComponent implements OnInit
hashPass: this.hashage(this.password)
};
this.messageService
.sendMessage('user/auth', data)
.subscribe( retour => this.maCallback(retour))
.post('user/auth', data)
.subscribe( retour => this.onSeConnecterCallback(retour));
}
}
onSeConnecterCallback(retour): void
{
console.log(retour);
if(retour.status !== 200)
{
console.log("noooo !");
//this.errorMessage = retour.error.data.reason;
//this.hasError = true;
}
else {
console.log("yeeess !");
//this.router.navigateByUrl( '/search' );
}
}
onForgottenPassword(): void
{
this.dialog
@ -63,19 +80,6 @@ export class PageLoginComponent implements OnInit
}
maCallback(retour): void
{
console.log(retour.data)
if(retour.status !== 200) {
this.errorMessage = retour.error.data.reason;
this.hasError = true;
}
else {
//this.router.navigateByUrl( '/search' );
}
}
checkError(): void
{
if(this.email === "") {