separacion del credito

This commit is contained in:
Andres2908
2022-05-10 23:36:28 -05:00
parent c3954b0110
commit 63fc909859
4 changed files with 47 additions and 14 deletions
+20
View File
@@ -0,0 +1,20 @@
const dbPath = '../../db/tablas';
const Usuario = require(`${dbPath}/Usuario`);
const { validarNumeroCuenta } = require('../../helper/validar');
const credito = async (body) => {
const numeroCuenta = validarNumeroCuenta(
body.numeroCuenta,
'número de cuenta',
true
);
return Usuario.findOne({
where: { numeroCuenta },
}).then(() => {
return Usuario.findOne({
attributes: ['credito', 'nombre', 'numeroCuenta'],
});
});
};
module.exports = credito;