iptdevs-design-system 3.1.278 → 3.1.281

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.
@@ -2750,6 +2750,11 @@ class CommercialService extends IPTGeneralService {
2750
2750
  let serviceUrl = this.SERVICE_URL + 'get/latest/cod/by/student/code/' + codeStudent;
2751
2751
  return this.http.get(serviceUrl, this.httpOptions);
2752
2752
  }
2753
+ updateCOD(request) {
2754
+ let serviceUrl = this.SERVICE_URL + 'post/update/cod';
2755
+ this.generateRequestParams(request);
2756
+ return this.http.post(serviceUrl, this.httpOptions);
2757
+ }
2753
2758
  }
2754
2759
  CommercialService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CommercialService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
2755
2760
  CommercialService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CommercialService, providedIn: 'root' });
@@ -4532,7 +4537,7 @@ class CodFormStepFiveComponent extends CodFormSteps {
4532
4537
  multiculturalism_6: [false, []],
4533
4538
  multiculturalism_7: [false, []],
4534
4539
  health_regimen: ['', [Validators.required]],
4535
- code_refers: [''],
4540
+ code_refers: ['null'],
4536
4541
  code_cod: [''],
4537
4542
  document_refers: [{ value: '', disabled: true }],
4538
4543
  name_refers: [{ value: '', disabled: true }],
@@ -4800,6 +4805,52 @@ class CodFormComponent {
4800
4805
  this.loaderMessage = 'Editando COD, espere un momento';
4801
4806
  let request = this.getUpdateCOD(totalData);
4802
4807
  console.log(request);
4808
+ this.commercialService.updateCOD(request).subscribe({
4809
+ next: (response) => {
4810
+ if (response.message.code === 1) {
4811
+ this.isLoading = false;
4812
+ this.loaderMessage = '';
4813
+ Swal.fire({
4814
+ title: 'Perfecto!',
4815
+ text: 'El COD ha sido Editado exitosamente.',
4816
+ icon: 'success'
4817
+ });
4818
+ this.localStorageCOD.clearData();
4819
+ this.okCreatedCOD.emit(true);
4820
+ }
4821
+ else if (response.message.code === 4) {
4822
+ this.isLoading = false;
4823
+ this.loaderMessage = '';
4824
+ const errorMessages = response.data.errors.map(error => `- ${error.message}`).join('<br>');
4825
+ Swal.fire({
4826
+ title: 'Revisar lo seleccionado en los campos',
4827
+ html: `${errorMessages}`,
4828
+ icon: 'warning'
4829
+ });
4830
+ }
4831
+ else {
4832
+ this.isLoading = false;
4833
+ this.loaderMessage = '';
4834
+ Swal.fire({
4835
+ title: 'Warning!',
4836
+ text: response.message.message,
4837
+ icon: 'error'
4838
+ });
4839
+ }
4840
+ },
4841
+ error: (err) => {
4842
+ this.isLoading = false;
4843
+ this.loaderMessage = '';
4844
+ Swal.fire({
4845
+ title: 'Error in cod creation',
4846
+ text: err.message,
4847
+ icon: 'error'
4848
+ });
4849
+ },
4850
+ complete: () => {
4851
+ this.codCreationSubscription = null;
4852
+ }
4853
+ });
4803
4854
  // this.commercialService.EditCod(request).subscribe({
4804
4855
  // next: (response: any) => {
4805
4856
  // this.isLoading = false;