Feature: Allow password change

This commit is contained in:
2021-06-21 10:45:45 +05:30
parent 72b0e0e97d
commit 27205f7790
4 changed files with 39 additions and 11 deletions

View File

@ -232,6 +232,15 @@
>
<h3 class="item-name">Users</h3>
</mat-card>
<mat-card
fxLayout="column"
class="square-button"
matRipple
*ngIf="auth.allowed('authenticated')"
[routerLink]="['/', 'users', 'me']"
>
<h3 class="item-name">Change Password</h3>
</mat-card>
<mat-card
fxLayout="column"
class="square-button"

View File

@ -73,7 +73,12 @@ export class UserDetailComponent implements OnInit, AfterViewInit {
this.ser.saveOrUpdate(this.getItem()).subscribe(
() => {
this.toaster.show('Success', '');
this.router.navigateByUrl('/users');
console.log(this.item.id);
if ((this.item.id as string) === 'me') {
this.router.navigateByUrl('/');
} else {
this.router.navigateByUrl('/users');
}
},
(error) => {
this.toaster.show('Error', error);