diff --git a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts index c4556a8..b929411 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts +++ b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts @@ -214,7 +214,7 @@ unavailability(action,obj) { console.log(this.practitionerdetails) if(this.userRole == 'PRACTITIONER'){ - this.endUserURL = this.end_User_Url+'practitioner/'+this.usersList.randStr + this.endUserURL = this.end_User_Url+'practitioner/'+this.usersList.randStr+"/details" } else if (this.userRole == 'BADMIN'){ this.endUserURL = this.end_User_Url+'business/'+this.usersList['BusinessDetails'][0].randStr } diff --git a/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts b/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts index 5dff102..f8883b6 100644 --- a/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts +++ b/ng-seed/src/app/end-user/doctor-profile/doctor-profile.component.ts @@ -16,9 +16,11 @@ export class DoctorProfileComponent implements OnInit { busName: any=[]; profileDetails: any; skillsDetails: any = []; - + consultants:any =[]; + ServicesMapDetailsList:any=[]; constructor(private router:Router,public end_user:EndUserService,private spinner:NgxSpinnerService) { // this.spinner.show() + this.getpractitionerList() } ngOnInit(): void { @@ -74,4 +76,70 @@ export class DoctorProfileComponent implements OnInit { return this.apiUrl+'imageViewer?img_name='+image; } + getpractitionerList() { + + let URL = this.router.url; + console.log(URL); + let URL_AS_LIST = URL.split('/'); + console.log(URL_AS_LIST); + //this._pd.getTabStatusPdDetails(this.tabStatus) + let params = { + "randStr":URL_AS_LIST[3], + "queryName":URL_AS_LIST[2] + + } + console.log(params); + + this.end_user.getcusServicesMapDetails(params).subscribe(res => { + if (res.status == 200) { + console.log(res) + let tmp =[] + let arr_val =res['data']; + this.ServicesMapDetailsList = arr_val + arr_val.forEach(element => { + tmp.push(element.user[0] ) + + }); + + + let filter = tmp.filter(arr=>{return arr.role == "PRACTITIONER"}) + console.log(tmp,filter) + + + let result = filter.filter((obj, index, self) => + + index === self.findIndex((t) => ( + + t.id=== obj.id + + + + + )) + ); + this.consultants = result; + setTimeout(() => { + /** spinner ends after 5 seconds */ + this.spinner.hide(); + }, 1000); + console.log(this.consultants) + + // let filter2 = this.consultants.filter(arr=>{return arr.userId == param.id && arr.busId ==param.busId}) + // console.log(filter) + localStorage.setItem('workingHrs',this.consultants[0].practitionerInfos + [0].workingHours) + this.end_user.appointmentBooked.next(this.ServicesMapDetailsList) + + this.bookedAppointment = this.ServicesMapDetailsList[0].user[0] + this.dp = this.apiUrl+'imageViewer?img_name='+ this.bookedAppointment.logo + console.log(this.dp) + this.profileDetails = this.bookedAppointment.practitionerInfos[0] + console.log(this.profileDetails) + this.skillsDetails = JSON.parse(this.profileDetails.skills) + // this.skillsDetails = JSON.parse(this.skillsDetails) + + } + }) + } + } diff --git a/ng-seed/src/app/end-user/end-user-routing.module.ts b/ng-seed/src/app/end-user/end-user-routing.module.ts index 4afd11e..4d3cfef 100644 --- a/ng-seed/src/app/end-user/end-user-routing.module.ts +++ b/ng-seed/src/app/end-user/end-user-routing.module.ts @@ -49,10 +49,10 @@ const routes: Routes = [{ path: 'business/:randstr', component: ServiceListComponent }, - { - path: 'practitioner/:randstr', - component: ConsultantsListComponent - }, + // { + // path: 'practitioner/:randstr', + // component: ConsultantsListComponent + // }, { path: 'practitioner/:randstr/details', component: DoctorProfileComponent