Files
inscripciones_api/server/controller/Admin/credito.js
T
2022-05-10 23:36:28 -05:00

21 lines
490 B
JavaScript

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;