separacion del credito
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user