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.
- package/esm2020/lib/cod/cod-form/cod-form.component.mjs +47 -1
- package/esm2020/lib/cod/steps/cod-form-step-five/cod-form-step-five.component.mjs +2 -2
- package/esm2020/lib/core/services/commercial-service/comercial.service.mjs +6 -1
- package/fesm2015/iptdevs-design-system.mjs +52 -1
- package/fesm2015/iptdevs-design-system.mjs.map +1 -1
- package/fesm2020/iptdevs-design-system.mjs +52 -1
- package/fesm2020/iptdevs-design-system.mjs.map +1 -1
- package/lib/core/services/commercial-service/comercial.service.d.ts +2 -1
- package/package.json +1 -1
|
@@ -2747,6 +2747,11 @@ class CommercialService extends IPTGeneralService {
|
|
|
2747
2747
|
let serviceUrl = this.SERVICE_URL + 'get/latest/cod/by/student/code/' + codeStudent;
|
|
2748
2748
|
return this.http.get(serviceUrl, this.httpOptions);
|
|
2749
2749
|
}
|
|
2750
|
+
updateCOD(request) {
|
|
2751
|
+
let serviceUrl = this.SERVICE_URL + 'post/update/cod';
|
|
2752
|
+
this.generateRequestParams(request);
|
|
2753
|
+
return this.http.post(serviceUrl, this.httpOptions);
|
|
2754
|
+
}
|
|
2750
2755
|
}
|
|
2751
2756
|
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 });
|
|
2752
2757
|
CommercialService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CommercialService, providedIn: 'root' });
|
|
@@ -4524,7 +4529,7 @@ class CodFormStepFiveComponent extends CodFormSteps {
|
|
|
4524
4529
|
multiculturalism_6: [false, []],
|
|
4525
4530
|
multiculturalism_7: [false, []],
|
|
4526
4531
|
health_regimen: ['', [Validators.required]],
|
|
4527
|
-
code_refers: [''],
|
|
4532
|
+
code_refers: ['null'],
|
|
4528
4533
|
code_cod: [''],
|
|
4529
4534
|
document_refers: [{ value: '', disabled: true }],
|
|
4530
4535
|
name_refers: [{ value: '', disabled: true }],
|
|
@@ -4791,6 +4796,52 @@ class CodFormComponent {
|
|
|
4791
4796
|
this.loaderMessage = 'Editando COD, espere un momento';
|
|
4792
4797
|
let request = this.getUpdateCOD(totalData);
|
|
4793
4798
|
console.log(request);
|
|
4799
|
+
this.commercialService.updateCOD(request).subscribe({
|
|
4800
|
+
next: (response) => {
|
|
4801
|
+
if (response.message.code === 1) {
|
|
4802
|
+
this.isLoading = false;
|
|
4803
|
+
this.loaderMessage = '';
|
|
4804
|
+
Swal.fire({
|
|
4805
|
+
title: 'Perfecto!',
|
|
4806
|
+
text: 'El COD ha sido Editado exitosamente.',
|
|
4807
|
+
icon: 'success'
|
|
4808
|
+
});
|
|
4809
|
+
this.localStorageCOD.clearData();
|
|
4810
|
+
this.okCreatedCOD.emit(true);
|
|
4811
|
+
}
|
|
4812
|
+
else if (response.message.code === 4) {
|
|
4813
|
+
this.isLoading = false;
|
|
4814
|
+
this.loaderMessage = '';
|
|
4815
|
+
const errorMessages = response.data.errors.map(error => `- ${error.message}`).join('<br>');
|
|
4816
|
+
Swal.fire({
|
|
4817
|
+
title: 'Revisar lo seleccionado en los campos',
|
|
4818
|
+
html: `${errorMessages}`,
|
|
4819
|
+
icon: 'warning'
|
|
4820
|
+
});
|
|
4821
|
+
}
|
|
4822
|
+
else {
|
|
4823
|
+
this.isLoading = false;
|
|
4824
|
+
this.loaderMessage = '';
|
|
4825
|
+
Swal.fire({
|
|
4826
|
+
title: 'Warning!',
|
|
4827
|
+
text: response.message.message,
|
|
4828
|
+
icon: 'error'
|
|
4829
|
+
});
|
|
4830
|
+
}
|
|
4831
|
+
},
|
|
4832
|
+
error: (err) => {
|
|
4833
|
+
this.isLoading = false;
|
|
4834
|
+
this.loaderMessage = '';
|
|
4835
|
+
Swal.fire({
|
|
4836
|
+
title: 'Error in cod creation',
|
|
4837
|
+
text: err.message,
|
|
4838
|
+
icon: 'error'
|
|
4839
|
+
});
|
|
4840
|
+
},
|
|
4841
|
+
complete: () => {
|
|
4842
|
+
this.codCreationSubscription = null;
|
|
4843
|
+
}
|
|
4844
|
+
});
|
|
4794
4845
|
// this.commercialService.EditCod(request).subscribe({
|
|
4795
4846
|
// next: (response: any) => {
|
|
4796
4847
|
// this.isLoading = false;
|