Skip to content

Commit

Permalink
AM - Renovación de matrícula Foto y Firma
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio-Ramirez committed Jul 22, 2024
1 parent fbae8ce commit 30f788c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/app/pages/profesional/mis-matriculas/firma-profesional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,15 @@ export class FirmaProfesionalPage implements OnInit {

if (this.base64Data) {
const strImage = this.base64Data.replace(/^data:image\/[a-z]+;base64,/, '');

let matriculaNumero = 0;
if (this.profesionalProvider.formacionGradoSelected?.value?.matriculacion?.length > 0) {
matriculaNumero = this.profesionalProvider.formacionGradoSelected.value.matriculacion[this.profesionalProvider.formacionGradoSelected.value.matriculacion?.length - 1].matriculaNumero;
}
const firmaProfesional = {
firmaP: strImage,
idProfesional: this.authProvider.user.profesionalId
idProfesional: this.authProvider.user.profesionalId,
matricula: matriculaNumero,
option: 'renovacionOnline'
};
this.profesionalProvider.updateProfesional(firmaProfesional.idProfesional, { firma: firmaProfesional }).then(() => {
this.toast.success('Firma Actualizada correctamente');
Expand All @@ -78,7 +83,3 @@ export class FirmaProfesionalPage implements OnInit {
this.disabledGuardar = this.signaturePad.isEmpty();
}
}




9 changes: 8 additions & 1 deletion src/app/pages/profesional/mis-matriculas/foto-profesional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,16 @@ export class FotoProfesionalPage implements OnInit {
confirmarFoto() {
if (this.foto) {
const strImage = this.foto.replace(/^data:image\/[a-z]+;base64,/, '');
let matriculaNumero = 0;
if (this.profesionalProvider.formacionGradoSelected?.value?.matriculacion?.length > 0) {
matriculaNumero = this.profesionalProvider.formacionGradoSelected.value.matriculacion[this.profesionalProvider.formacionGradoSelected.value.matriculacion?.length - 1].matriculaNumero;

}
const imagenPro = {
img: strImage,
idProfesional: this.authProvider.user.profesionalId
idProfesional: this.authProvider.user.profesionalId,
matricula: matriculaNumero,
option: 'renovacionOnline'
};

this.profesionalProvider.updateProfesional(imagenPro.idProfesional, { imagen: imagenPro }).then(() => {
Expand Down

0 comments on commit 30f788c

Please sign in to comment.