modified newSaldo
This commit is contained in:
@@ -112,6 +112,10 @@ export class PersonaService {
|
||||
select: { cantidadCuenta: true },
|
||||
});
|
||||
|
||||
if (!persona) {
|
||||
throw new NotFoundException('user not found');
|
||||
}
|
||||
|
||||
return persona?.cantidadCuenta;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,12 @@ export class OperationsService {
|
||||
|
||||
this.pagoKioscoService.create(pagoKiosco);
|
||||
|
||||
const newSaldo = this.personaService.updateSaldo(idPersona, cantidad);
|
||||
let newSaldo: number;
|
||||
if (transaccion === 'Inscripcion') {
|
||||
newSaldo = await this.personaService.saldo(idPersona);
|
||||
} else {
|
||||
newSaldo = await this.personaService.updateSaldo(idPersona, cantidad);
|
||||
}
|
||||
|
||||
return newSaldo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user