@idsoftsource/initial-process 1.7.3 → 1.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -632,6 +632,12 @@ class UserDetailService {
632
632
  initialSetUpCreateUserDetail(model) {
633
633
  return this.http.post(`${this.baseUrl}/InitialSetUpCreateUserDetail`, model);
634
634
  }
635
+ /* ==============================
636
+ INITIAL SETUP
637
+ ============================== */
638
+ updateMyProfileData(model) {
639
+ return this.http.post(`${this.baseUrl}/UpdateMyProfile`, model);
640
+ }
635
641
  /* ==============================
636
642
  GET USER ACCOUNTS
637
643
  ============================== */
@@ -3932,7 +3938,12 @@ class PreviewComponent {
3932
3938
  payload.userDetail.isInitialSetupCompleted = true;
3933
3939
  this.isSavingBasic = true;
3934
3940
  try {
3935
- await firstValueFrom(this.userDetailService.initialSetUpCreateUserDetail(payload));
3941
+ if (this.roleContextService?.tempUserContext()?.userId) {
3942
+ await firstValueFrom(this.userDetailService.updateMyProfileData(payload.userDetail));
3943
+ }
3944
+ else {
3945
+ await firstValueFrom(this.userDetailService.initialSetUpCreateUserDetail(payload));
3946
+ }
3936
3947
  this.showDashboardConfirmPopup = false;
3937
3948
  window.location.href = this.libConfig.dashboardUrl;
3938
3949
  }
@@ -3948,7 +3959,12 @@ class PreviewComponent {
3948
3959
  payload.userDetail.isInitialSetupCompleted = true;
3949
3960
  this.isSavingBasic = true;
3950
3961
  try {
3951
- await firstValueFrom(this.userDetailService.initialSetUpCreateUserDetail(payload));
3962
+ if (this.roleContextService?.tempUserContext()?.userId) {
3963
+ await firstValueFrom(this.userDetailService.updateMyProfileData(payload.userDetail));
3964
+ }
3965
+ else {
3966
+ await firstValueFrom(this.userDetailService.initialSetUpCreateUserDetail(payload));
3967
+ }
3952
3968
  this.showDashboardConfirmPopup = false;
3953
3969
  window.location.href = this.libConfig.dashboardUrl;
3954
3970
  }
@@ -3996,7 +4012,12 @@ class PreviewComponent {
3996
4012
  this.commitProfile({ ...current, basicDetails: { ...this.tempProfile } });
3997
4013
  const payload = this.mapBasicDetailsToUserDetail(this.resumeData);
3998
4014
  if (payload) {
3999
- await firstValueFrom(this.userDetailService.initialSetUpCreateUserDetail(payload));
4015
+ if (this.roleContextService?.tempUserContext()?.userId) {
4016
+ await firstValueFrom(this.userDetailService.updateMyProfileData(payload.userDetail));
4017
+ }
4018
+ else {
4019
+ await firstValueFrom(this.userDetailService.initialSetUpCreateUserDetail(payload));
4020
+ }
4000
4021
  this.hasUserDetailData = true;
4001
4022
  this.basicDetailsSaved = true; // ✅ only on success
4002
4023
  }
@@ -8162,6 +8183,9 @@ class ToolsComponent {
8162
8183
  this.store.previousStep();
8163
8184
  }
8164
8185
  saveFinal() {
8186
+ if (this.roleData.role.name == 'Provider') {
8187
+ this.providerId = localStorage.getItem('providerId');
8188
+ }
8165
8189
  this.homeLoader = true;
8166
8190
  this.userDetailService
8167
8191
  .getByUserId(this.userId, {})
@@ -8658,6 +8682,7 @@ class RoleSelectComponent {
8658
8682
  .subscribe((data) => {
8659
8683
  if (!data.failed) {
8660
8684
  localStorage.setItem('providerId', data?.value);
8685
+ this.providerId = localStorage.getItem('providerId');
8661
8686
  }
8662
8687
  else if (data?.failed) {
8663
8688
  for (let i = 0; i < data.failures.length; i++) {