From 2a41601026ba84b1f52fc102691d0819a4b97de8 Mon Sep 17 00:00:00 2001 From: "surendar.m@watermelon.us" Date: Tue, 11 Apr 2023 13:10:41 +0530 Subject: [PATCH] password encryption --- .../customers-list.component.ts | 62 ++++++++++--------- .../user/user-list/user-list.component.html | 2 +- .../user/user-list/user-list.component.ts | 4 +- 3 files changed, 36 insertions(+), 32 deletions(-) diff --git a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts index 8b8d989..3d8b8c0 100644 --- a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts +++ b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts @@ -100,6 +100,38 @@ export class CustomersListComponent implements OnInit { }); + this._cus.getCustomersListDetails().subscribe(res => { + if (res.status == 200) { + this.isLoading = false + this.customersList = res.data; + console.log(this.customersList) + this.customersListLength = res.data.length; + console.log(this.customersListLength) + this.customersListSource['data'] = this.customersList; + console.log(this.customersListSource) + this.recordStatus=false; + + console.log(this.customersList,this.appoinmentsIds) + let user_role = localStorage.getItem('user_role'); + if(user_role == 'PRACTITIONER'){ + const activeIds = this.appoinmentsIds + const serviceList = this.customersList + console.log(activeIds,serviceList) + + const result = serviceList.filter(({id}) => activeIds.includes(id)); + console.log(result) + this.customersList = result + this.customersListSource['data'] = this.customersList; + + } + + } + else{ + this.customersList=[]; + this.customersListLength= null; + this.recordStatus=true; + } +}, error => this.isLoading = false); } else{ @@ -107,37 +139,7 @@ export class CustomersListComponent implements OnInit { } }) } - this._cus.getCustomersListDetails().subscribe(res => { - if (res.status == 200) { - this.isLoading = false - this.customersList = res.data; - console.log(this.customersList) - this.customersListLength = res.data.length; - console.log(this.customersListLength) - this.customersListSource['data'] = this.customersList; - console.log(this.customersListSource) - this.recordStatus=false; - console.log(this.customersList,this.appoinmentsIds) - let user_role = localStorage.getItem('user_role'); - if(user_role == 'PRACTITIONER'){ - const activeIds = this.appoinmentsIds - const serviceList = this.customersList - - const result = serviceList.filter(({id}) => activeIds.includes(id)); - console.log(result) - this.customersList = result - this.customersListSource['data'] = this.customersList; - - } - - } - else{ - this.customersList=[]; - this.customersListLength= null; - this.recordStatus=true; - } - }, error => this.isLoading = false); } diff --git a/ng-seed/src/app/appoinment/user/user-list/user-list.component.html b/ng-seed/src/app/appoinment/user/user-list/user-list.component.html index 2e53bee..cf7040c 100644 --- a/ng-seed/src/app/appoinment/user/user-list/user-list.component.html +++ b/ng-seed/src/app/appoinment/user/user-list/user-list.component.html @@ -67,7 +67,7 @@ Password - {{element.password}} + {{hashPassword(element.password)}} diff --git a/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts b/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts index 34fe864..7cb45f1 100644 --- a/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts +++ b/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts @@ -107,7 +107,9 @@ export class UserListComponent implements OnInit { // alert(error.html_format); }) } - + hashPassword(password: string){ + return "*".repeat(password.length) + } ngAfterViewInit() { console.log(this.usersList,this.paginator) this.usersList.paginator = this.paginator;