iptdevs-design-system 3.1.168 → 3.1.170

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.
@@ -879,6 +879,11 @@ class UserService extends IPTGeneralService {
879
879
  this.generateRequestParams(params);
880
880
  return this.http.post(serviceUrl, this.httpOptions);
881
881
  }
882
+ obtainReferralUsers(token) {
883
+ let serviceUrl = this.SERVICE_URL + 'post/obtain/referral/users';
884
+ this.generateRequestParams(token);
885
+ return this.http.post(serviceUrl, this.httpOptions);
886
+ }
882
887
  }
883
888
  UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: UserService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
884
889
  UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: UserService, providedIn: 'root' });
@@ -3104,15 +3109,21 @@ class CodFormStepOneComponent extends CodFormSteps {
3104
3109
  this.copies = this.copiesService.copies;
3105
3110
  }
3106
3111
  ngOnInit() {
3107
- this.getParameters();
3108
- this.initForm();
3109
- this.startLocalStorageWork();
3110
- this.setValuesByLocalStorage();
3111
3112
  this.codFormStepOne.controls['course_type'].valueChanges
3112
3113
  .subscribe(value => this.communicatorService.setCurrentCourseType(value));
3113
3114
  this.communicatorService.setCurrentAgreement(this.localStorageCOD.getCodFormData(1, 'agreement_by_category'));
3114
3115
  }
3116
+ /* Es necesario recorrer el array de controls de nuestro formulario para:
3117
+ ✅ Leer el Local Storage y setear los valores
3118
+ ✅ Subscribirse a los cambios del formulario para setear valores nuevos
3119
+
3120
+ Nota: la clase CodFormSteps() se encarga de toda la lógica de LS con los pasos del formulario del COD
3121
+ */
3115
3122
  ngOnChanges(changes) {
3123
+ this.getParameters();
3124
+ this.initForm();
3125
+ this.startLocalStorageWork();
3126
+ this.setValuesByLocalStorage();
3116
3127
  if (changes['courseSelect']) {
3117
3128
  console.log(this.courseSelect);
3118
3129
  if (this.courseSelect != null) {
@@ -3122,15 +3133,20 @@ class CodFormStepOneComponent extends CodFormSteps {
3122
3133
  // }else{
3123
3134
  // this.setDataFromUserHistory();
3124
3135
  // }
3136
+ this.setDataFromUserHistory();
3137
+ }
3138
+ else {
3139
+ console.log(this.courseSelect);
3125
3140
  }
3126
3141
  }
3127
3142
  }
3128
- /* Es necesario recorrer el array de controls de nuestro formulario para:
3129
- ✅ Leer el Local Storage y setear los valores
3130
- ✅ Subscribirse a los cambios del formulario para setear valores nuevos
3131
-
3132
- Nota: la clase CodFormSteps() se encarga de toda la lógica de LS con los pasos del formulario del COD
3133
- */
3143
+ setDataFromUserHistory() {
3144
+ this.codFormStepOne.controls['academic_plan'].setValue(this.courseSelect.course_type.academic_plan.code);
3145
+ this.codFormStepOne.controls['course_type'].setValue(this.courseSelect.agreement);
3146
+ this.codFormStepOne.controls['agreement_by_category'].setValue(this.courseSelect.course_type.code);
3147
+ this.codFormStepOne.controls['english_level'].setValue(this.courseSelect.english_level);
3148
+ this.codFormStepOne.controls['availible_courses'].setValue(this.courseSelect.code);
3149
+ }
3134
3150
  startLocalStorageWork() {
3135
3151
  this.controls.forEach(control => {
3136
3152
  let localStorageValue = this.readAndWriteLS(1, control.name);
@@ -4276,7 +4292,7 @@ class ModalReferredComponent {
4276
4292
  param: form.value.searchUser,
4277
4293
  };
4278
4294
  if (form.value.searchUser != "") {
4279
- this.userService.getStudent(request).subscribe((response) => {
4295
+ this.userService.obtainReferralUsers(request).subscribe((response) => {
4280
4296
  if (response.data == null) {
4281
4297
  this.userExists = false;
4282
4298
  Swal.fire({