iptdevs-design-system 3.2.1 → 3.2.2

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.
@@ -1886,7 +1886,6 @@ class updateUserFormComponent {
1886
1886
  this.stratums = [];
1887
1887
  this.showConfirmDialog = false;
1888
1888
  this.userRoleCommercial = false;
1889
- // userUpdated = false;
1890
1889
  this.initialFormValue = [];
1891
1890
  this.pendingInit = false;
1892
1891
  this.isStudent = false;
@@ -2225,7 +2224,7 @@ class updateUserFormComponent {
2225
2224
  Validators.required,
2226
2225
  Validators.minLength(5),
2227
2226
  Validators.maxLength(20),
2228
- Validators.pattern(/^[a-zA-Z0-9]*$/) // Letras y números
2227
+ Validators.pattern(/^[a-zA-Z0-9]*$/)
2229
2228
  ]);
2230
2229
  }
2231
2230
  else {
@@ -2233,7 +2232,7 @@ class updateUserFormComponent {
2233
2232
  Validators.required,
2234
2233
  Validators.minLength(5),
2235
2234
  Validators.maxLength(20),
2236
- Validators.pattern(/^[0-9]*$/) // Solo números
2235
+ Validators.pattern(/^[0-9]*$/)
2237
2236
  ]);
2238
2237
  }
2239
2238
  idCardControl.updateValueAndValidity();
@@ -2337,84 +2336,6 @@ class updateUserFormComponent {
2337
2336
  selectReason(reason) {
2338
2337
  this.confirmForm.controls['reason'].setValue(reason ? reason : null);
2339
2338
  }
2340
- // updateUser(): void {
2341
- // if (
2342
- // this.updateUserForm.invalid ||
2343
- // this.updateUserForm.hasError('mismatch') ||
2344
- // !this.hasFormChanged()
2345
- // ) {
2346
- // this.updateUserForm.markAllAsTouched();
2347
- // console.log('createUser - Validation failed:', {
2348
- // invalid: this.updateUserForm.invalid,
2349
- // mismatch: this.updateUserForm.hasError('mismatch'),
2350
- // hasChanges: this.hasFormChanged()
2351
- // });
2352
- // return;
2353
- // }
2354
- // this.loader = true;
2355
- // const formValue = this.updateUserForm.getRawValue();
2356
- // const request:any = {
2357
- // token: this.baseService.getUserToken(),
2358
- // user: {
2359
- // code: this.DataStudent.code,
2360
- // name: formValue.name,
2361
- // last_name: formValue.last_name,
2362
- // id_card_type: formValue.id_card_type,
2363
- // id_card: formValue.id_card,
2364
- // phone_indicative: formValue.phone_indicative,
2365
- // phone_number: formValue.phone_number,
2366
- // email: formValue.email,
2367
- // gender: formValue.gender,
2368
- // city: formValue.city,
2369
- // service_hour: formValue.service_hour,
2370
- // role: this.DataStudent.role,
2371
- // status: formValue.status,
2372
- // ...(this.showEmailIpt ? { email_ipt: formValue.email_ipt } : {}),
2373
- // ...(formValue.changePassword && formValue.password ? { password: formValue.password } : {})
2374
- // },
2375
- // parent: this.showParentSection
2376
- // ? {
2377
- // code: this.DataStudent.cods?.parent?.code || null,
2378
- // name: formValue.parent_name || null,
2379
- // last_name: formValue.parent_last_name || null,
2380
- // id_card_type: formValue.parent_id_card_type || null,
2381
- // id_card: formValue.parent_id_card || null,
2382
- // phone_indicative: formValue.parent_phone_indicative || null,
2383
- // phone_number: formValue.parent_phone_number || null,
2384
- // occupation: formValue.parent_occupation || null,
2385
- // office_adrress: formValue.parent_office_adrress || null,
2386
- // email: formValue.parent_email || null
2387
- // }
2388
- // : null
2389
- // };
2390
- // console.log(request);
2391
- // this.userService.updateUserAndParentByCode(request).subscribe((response) => {
2392
- // // this.courseType = response.data;
2393
- // if (response.message.code === 1) {
2394
- // Swal.fire({
2395
- // position: 'center',
2396
- // icon: 'success',
2397
- // title: 'usuario actualizado satisfactoriamente',
2398
- // showConfirmButton: false,
2399
- // timer: 2500,
2400
- // });
2401
- // // this.userUpdated = true
2402
- // this.userUpdatedEvent.emit();
2403
- // this.closeTable();
2404
- // }else{
2405
- // Swal.fire({
2406
- // position: 'center',
2407
- // icon: 'error',
2408
- // title: 'Ha ocurrido un error inesperado',
2409
- // text: response.data.message,
2410
- // showConfirmButton: false,
2411
- // timer: 2500,
2412
- // });
2413
- // // this.userUpdated = false
2414
- // }
2415
- // });
2416
- // this.loader = false;
2417
- // }
2418
2339
  hasFormChanged() {
2419
2340
  if (!this.initialFormValue || !this.DataStudent) {
2420
2341
  return false;
@@ -2599,7 +2520,6 @@ class updateUserFormComponent {
2599
2520
  reason: confirmValue.reason,
2600
2521
  observation: confirmValue.observation,
2601
2522
  };
2602
- console.log(request);
2603
2523
  this.userService.updateUserByCode(request).subscribe({
2604
2524
  next: (response) => {
2605
2525
  if (response.message.code === 1) {
@@ -2613,12 +2533,12 @@ class updateUserFormComponent {
2613
2533
  this.userUpdatedEvent.emit();
2614
2534
  this.closeTable();
2615
2535
  }
2616
- else {
2536
+ else if (response.message.code === 3) {
2617
2537
  Swal.fire({
2618
2538
  position: 'center',
2619
- icon: 'error',
2620
- title: 'Ha ocurrido un error inesperado',
2621
- text: response.data.message,
2539
+ icon: 'warning',
2540
+ title: response.data.message,
2541
+ text: response.data.errors,
2622
2542
  showConfirmButton: false,
2623
2543
  timer: 2500,
2624
2544
  });
@@ -2630,7 +2550,7 @@ class updateUserFormComponent {
2630
2550
  Swal.fire({
2631
2551
  position: 'center',
2632
2552
  icon: 'error',
2633
- title: 'Error al actualizar el usuario',
2553
+ title: 'Ha ocurrido un error inesperado',
2634
2554
  showConfirmButton: false,
2635
2555
  timer: 2500,
2636
2556
  });