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 c3ec73c..acbac35 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 @@ -194,7 +194,13 @@ unavailability(action,obj) { console.log( this.practitionerdetails) this._con.getPractitionerInfo.next( this.usersList['practitionerInfos']); console.log(this.practitionerdetails) - this.endUserURL = this.end_User_Url+this.usersList['BusinessDetails'][0].randStr + + if(this.userRole == 'PRACTITIONER'){ + this.endUserURL = this.end_User_Url+'practitioner/'+this.usersList.randStr + } else if (this.userRole == 'BADMIN'){ + this.endUserURL = this.end_User_Url+'business/'+this.usersList['BusinessDetails'][0].randStr + } + this.workinghours = JSON.parse(this.practitionerdetails.workingHours) this.skills= JSON.parse(this.practitionerdetails.skills) this.id=this.practitionerdetails.id @@ -356,7 +362,7 @@ unavailability(action,obj) { save(){ this.isEditable = false; let userid = localStorage.getItem('user_id') - let param: any = { "exp": this.exp, + let param: any = { "exp": this.exp, // "id": this.id, "qualification": this.qualification, "fees": "800", @@ -366,7 +372,7 @@ unavailability(action,obj) { "gender": this.gender, "workingHours": JSON.stringify([{"sunday":{"hours":[{"startTime":"09:30 am","endTime":"06:00 pm","day":"sunday","value":null}],"breaks":[]}},{"monday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"monday","value":null}],"breaks":[]}},{"tuesday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"tuesday","value":null}],"breaks":[]}},{"wednesday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"wednesday","value":null}],"breaks":[]}},{"thursday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"thursday","value":null}],"breaks":[]}},{"friday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"friday","value":null}],"breaks":[]}},{"saturday":{"hours":[{"startTime":"09:00 am","endTime":"06:00 pm","day":"saturday","value":null}],"breaks":[]}}]), "description": this.description, - "skills": this.skills, + "skills": JSON.stringify(this.skills), "caption": this.caption, "userName": this.userName, "practitionerId":userid diff --git a/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.ts b/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.ts index 57f01f1..bff7e21 100644 --- a/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.ts +++ b/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.ts @@ -43,6 +43,8 @@ ngOnInit() { description: new FormControl('',[Validators.required]), fees:new FormControl('',[Validators.required]) }); + console.log(this.local_data) + this.local_data.duration = JSON.stringify(this.local_data.duration) this.form.patchValue(this.local_data) } diff --git a/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.html b/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.html index dcb60be..894843e 100644 --- a/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.html +++ b/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.html @@ -32,7 +32,7 @@ Duration - {{row.duration}} + {{row.duration}} Mins Fees 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 8ad5c6e..7c07159 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 @@ -76,24 +76,31 @@ export class UserListComponent implements OnInit { this.getBusinessList() } getUsersList() { - //this._pd.getTabStatusPdDetails(this.tabStatus) - this._use.getUsersListDetails().subscribe(res => { - if (res.status == 200) { - this.isLoading = false - let usersList = res.data - usersList.sort((a: any, b: any) => { - return b.id - a.id; - }); - this.usersList['data'] = usersList; - this.usersListLength = res.data.length; - this.recordStatus=false; - } - else{ - // this.usersList=[]; - // this.dataSource = null; - this.recordStatus=true; - } - },error => this.isLoading = false); + let userRole = localStorage.getItem('user_role') + let param; + if(userRole == 'BADMIN'){ + param ={"busId": localStorage.getItem('busId')} + }else { + param = {} + } + this._use.getUsersListDetails(param).subscribe(res => { + if (res.status == 200) { + this.isLoading = false + let usersList = res.data + usersList.sort((a: any, b: any) => { + return b.id - a.id; + }); + this.usersList['data'] = usersList; + this.usersListLength = res.data.length; + this.recordStatus=false; + } + else{ + // this.usersList=[]; + // this.dataSource = null; + this.recordStatus=true; + } + },error => this.isLoading = false); + } getBusinessList() { //this._pd.getTabStatusPdDetails(this.tabStatus) diff --git a/ng-seed/src/app/appoinment/user/user-service/user.service.ts b/ng-seed/src/app/appoinment/user/user-service/user.service.ts index 6df9ad4..8d9ec72 100644 --- a/ng-seed/src/app/appoinment/user/user-service/user.service.ts +++ b/ng-seed/src/app/appoinment/user/user-service/user.service.ts @@ -11,10 +11,17 @@ export class UserService { private apiUrl = environment.apiEndpoint; constructor(private _http: HttpClient) { } - - getUsersListDetails(): Observable { + getUsersListDetails2(): Observable { console.log('IN') - return this._http.get(this.apiUrl + "getusers") + return this._http.post(this.apiUrl + "getusers",{}) + // .pipe( + // catchError(this.handleError('role', [])) + // ) + } + + getUsersListDetails(param): Observable { + console.log('IN') + return this._http.post(this.apiUrl + "getusers",param) // .pipe( // catchError(this.handleError('role', [])) // ) diff --git a/ng-seed/src/app/end-user/search-category/search-category.component.ts b/ng-seed/src/app/end-user/search-category/search-category.component.ts index 5221884..6fbdd62 100644 --- a/ng-seed/src/app/end-user/search-category/search-category.component.ts +++ b/ng-seed/src/app/end-user/search-category/search-category.component.ts @@ -123,7 +123,7 @@ export class SearchCategoryComponent implements OnInit { } }); } else if(this.eventData == 'consultants'){ - this._use.getUsersListDetails().subscribe(res => { + this._use.getUsersListDetails2().subscribe(res => { if (res.status == 200) { console.log(res) // let data = res['data'].filter(val => val.role == 'PRACTITIONER') diff --git a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html index 0f8e68f..ffcdb49 100644 --- a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html +++ b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.html @@ -81,7 +81,7 @@

AvatarTime :

{{slotTime | date:'shortTime'}}

AvatarAmount :

- {{user.practitionerInfos[0].days}} + {{durationArray.length>0 ? durationArray.fees : servicesName.fees}} diff --git a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.ts b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.ts index 2b3e958..b100347 100644 --- a/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.ts +++ b/ng-seed/src/app/end-user/slot-booking/slot-booking-details.component.ts @@ -51,11 +51,15 @@ export class SlotBookingDetailsComponent implements OnInit { doctor: any=[]; servicesName: any=[]; user: any=[]; + durationArray: any; constructor(private router:Router,private datepipe:DatePipe,public end_user:EndUserService) { this.end_user.appointmentBooked_observable$.subscribe((res) => { console.log('booked', res); if(res.length>0){ + console.log(res[0]) + this.durationArray = res[0] this.servicesName = res[0].service[0] + console.log(this.servicesName) this.user = res[0].user[0] this.doctor = res[0].user[0].userName this.getApiData() diff --git a/ng-seed/src/environments/environment.ts b/ng-seed/src/environments/environment.ts index 75d19cb..5d1e46d 100644 --- a/ng-seed/src/environments/environment.ts +++ b/ng-seed/src/environments/environment.ts @@ -10,11 +10,11 @@ export const environment = { // apiEndpoint:'http://192.168.1.20:8080/api/', // apiEndpoint:'https://api.venbait.in/api/', // apiEndpoint:'http://venbainfotech.com:5000/api/', - apiEndpoint:'http://192.168.1.4:8080/api/', + apiEndpoint:'http://192.168.1.8:8080/api/', // apiEndpoint:'https://api.venbait.in/api/', //EndUser URL - endUserUrl:'https://venbainfotech.com/appointment/#/customer/business/', + endUserUrl:'https://venbainfotech.com/appointment/#/customer/', firebase: { apiKey: "AIzaSyCKbfDJ5Qf0rDP3WKppa94u9xuVaVabaDw",