More errors added
This commit is contained in:
parent
b45bc19ba7
commit
c1381b812c
7 changed files with 124 additions and 13 deletions
|
@ -17,15 +17,15 @@
|
|||
<input type="password" class="form-control" formControlName="password" placeholder="Password">
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<div [ngSwitch]="loginStatus">
|
||||
<div *ngSwitchCase="'success'" class="alert alert-success" role="alert">
|
||||
Login Succeeded, routing to homepage.
|
||||
</div>
|
||||
<div *ngSwitchCase="'send_failed'" class="alert alert-danger" role="alert">
|
||||
Error received, please try again.
|
||||
</div>
|
||||
<div [ngSwitch]="loginStatus">
|
||||
<div *ngSwitchCase="'success'" class="alert alert-success" role="alert">
|
||||
Login Succeeded, routing to homepage.
|
||||
</div>
|
||||
<div *ngSwitchCase="'send_failed'" class="alert alert-danger" role="alert">
|
||||
Error received, please try again.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<button type="submit" [disabled]="!signin.valid" class="btn btn-primary px-4">Login</button>
|
||||
|
|
|
@ -134,12 +134,12 @@
|
|||
</div>
|
||||
<div heading="Pending" *ngSwitchDefault>Please Select a User Type</div>
|
||||
</div>
|
||||
<div [ngSwitch]="registerStatus">
|
||||
<div class="mb-3" [ngSwitch]="registerStatus">
|
||||
<div *ngSwitchCase="'success'" class="alert alert-success" role="alert">
|
||||
Register Succeeded.
|
||||
</div>
|
||||
<div *ngSwitchCase="'validation_failed'" class="alert alert-danger" role="alert">
|
||||
Form validation failed, please ensure the form is filled.
|
||||
Form validation failed, please ensure the form is filled correctly.
|
||||
</div>
|
||||
<div *ngSwitchCase="'send_failed'" class="alert alert-danger" role="alert">
|
||||
Failed to send to server, please try again later.
|
||||
|
|
|
@ -81,10 +81,14 @@ export class RegisterComponent {
|
|||
.subscribe(
|
||||
result => {
|
||||
console.log('registered!');
|
||||
this.registerStatus = "success";
|
||||
console.log(this.registerStatus);
|
||||
this.router.navigate(['/dashboard']);
|
||||
},
|
||||
error => {
|
||||
console.log( error._body );
|
||||
this.registerStatus = "send_failed";
|
||||
console.log(this.registerStatus)
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Reference in a new issue