@idsoftsource/initial-process 0.1.7 → 0.1.8

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.
@@ -5062,8 +5062,15 @@ class RoleSelectComponent {
5062
5062
  });
5063
5063
  this.userId = await this.tokenService.getUserId();
5064
5064
  this.useremail = await this.tokenService.getUserEmail();
5065
+ const stored = localStorage.getItem(this.mappingKey());
5066
+ if (stored === 'true') {
5067
+ this.isMappingCreated = true;
5068
+ }
5065
5069
  this.getUserDetail();
5066
5070
  }
5071
+ mappingKey() {
5072
+ return `provider-user-mapping-${this.providerId}-${this.userId}`;
5073
+ }
5067
5074
  getYears() {
5068
5075
  if (this.expYears?.length)
5069
5076
  return;
@@ -5390,9 +5397,11 @@ class RoleSelectComponent {
5390
5397
  this.showLoader = true;
5391
5398
  let apiCall$;
5392
5399
  if (!this.isMappingCreated) {
5400
+ // 🆕 FIRST TIME → POST
5393
5401
  apiCall$ = this.provideruser.createProviderUserMapping(model);
5394
5402
  }
5395
5403
  else if (this.previousEmployeeType !== currentEmployeeType) {
5404
+ // 🔁 SECOND TIME → PUT
5396
5405
  apiCall$ = this.provideruser.updateProviderUserMapping(model);
5397
5406
  }
5398
5407
  else {
@@ -5407,8 +5416,10 @@ class RoleSelectComponent {
5407
5416
  this.userError = res.failures?.[0]?.message;
5408
5417
  return;
5409
5418
  }
5419
+ // ✅ persist existence
5410
5420
  this.isMappingCreated = true;
5411
5421
  this.previousEmployeeType = currentEmployeeType;
5422
+ localStorage.setItem(this.mappingKey(), 'true');
5412
5423
  this.store.nextStep();
5413
5424
  },
5414
5425
  error: (err) => {