iptdevs-design-system 3.2.8 → 3.2.9

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.
@@ -2411,16 +2411,20 @@ class updateUserFormComponent {
2411
2411
  if (this.showEmailIptAndServiceHour) {
2412
2412
  // Agregar campos y validadores si no estaban presentes
2413
2413
  if (!emailIptControl) {
2414
- this.updateUserForm.addControl('email_ipt', this.fb.control('', [Validators.required, Validators.email, Validators.maxLength(250)]));
2414
+ const emailIptValue = this.DataStudent.email_ipt || '';
2415
+ this.updateUserForm.addControl('email_ipt', this.fb.control(emailIptValue, [Validators.required, Validators.email, Validators.maxLength(250)]));
2415
2416
  }
2416
2417
  else {
2417
2418
  emailIptControl.setValidators([Validators.required, Validators.email, Validators.maxLength(250)]);
2419
+ emailIptControl.setValue(this.DataStudent.email_ipt || '');
2418
2420
  }
2419
2421
  if (!serviceHourControl) {
2420
- this.updateUserForm.addControl('service_hour', this.fb.control('', [Validators.required, Validators.pattern(/^[0-9]+$/), Validators.min(0), Validators.max(44)]));
2422
+ const serviceHourValue = this.DataStudent.service_hour != null ? this.DataStudent.service_hour : 0; // Usa 0 como fallback
2423
+ this.updateUserForm.addControl('service_hour', this.fb.control(serviceHourValue, [Validators.required, Validators.pattern(/^[0-9]+$/), Validators.min(0), Validators.max(44)]));
2421
2424
  }
2422
2425
  else {
2423
2426
  serviceHourControl.setValidators([Validators.required, Validators.pattern(/^[0-9]+$/), Validators.min(0), Validators.max(44)]);
2427
+ serviceHourControl.setValue(this.DataStudent.service_hour != null ? this.DataStudent.service_hour : 0);
2424
2428
  }
2425
2429
  }
2426
2430
  else {