|
|
|
@@ -21,8 +21,7 @@ export class ProfilePage implements OnInit { |
|
|
|
private toastService: ToastService |
|
|
|
) { } |
|
|
|
|
|
|
|
ngOnInit() { |
|
|
|
this.userInfo = JSON.parse(localStorage.userInfo)['User Info']; |
|
|
|
ngOnInit() { |
|
|
|
} |
|
|
|
|
|
|
|
updateUserInfo() { |
|
|
|
@@ -33,16 +32,28 @@ export class ProfilePage implements OnInit { |
|
|
|
email: this.userInfo.email, |
|
|
|
} |
|
|
|
|
|
|
|
this.authService.updateUser(tempUserInfo).then((data) => { |
|
|
|
console.log(data); |
|
|
|
this.authService.updateUser(tempUserInfo).then(() => { |
|
|
|
this.toastService.presentToast("Updated!", "success"); |
|
|
|
}, (err) => { |
|
|
|
console.log(err); |
|
|
|
}, () => { |
|
|
|
this.toastService.presentToast("Failed to update", "danger"); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
ionViewDidEnter() { |
|
|
|
this.userInfo = JSON.parse(localStorage.userInfo)['User Info']; |
|
|
|
|
|
|
|
this.authService.getUserDetails(this.userInfo.id).then((data: any) => { |
|
|
|
this.userInfo.mobile = data.mobile; |
|
|
|
this.userInfo.email = data.email; |
|
|
|
|
|
|
|
let info = JSON.parse(localStorage.userInfo); |
|
|
|
info['User Info'] = this.userInfo; |
|
|
|
localStorage.userInfo = JSON.stringify(info); |
|
|
|
}, () => { |
|
|
|
this.toastService.presentToast("Failed to get user data"); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.selected_tab = ''; |
|
|
|
setTimeout(() => { |
|
|
|
this.selected_tab = 'MY ORDERS'; |
|
|
|
|