in ngo-ui/src/app/ui/signin/signin.component.ts [52:76]
login() {
if (this.loading) {
return;
}
this.error = null;
this.submitted = true;
this.loading = true;
if (this.userForm.invalid) {
this.loading = false;
return;
}
const user = this.userForm.value;
const resp = this.userService.signin(user).subscribe(
data => {
const fistrecord = data[0];
const donor = new Donor().get(fistrecord.donorUserName, fistrecord.email);
this.userService.setAuth(donor);
this.router.navigate(['ngolist']);
},
err => {
this.loading = false;
this.error = 'User not found';
}
);
}