validar texto

This commit is contained in:
xXpuma99Xx
2022-01-02 15:27:30 -06:00
parent 9b153520e8
commit 0b04777c0c
9 changed files with 18 additions and 12 deletions
+2 -2
View File
@@ -23,10 +23,10 @@ const nuevo = async (body, file) => {
200
);
const institucion = body.institucion
? validar.validarTexto(body.institucion, 'El texto institucion.', 200)
? validar.validarTexto(body.institucion, 'institucion', false, 200)
: '';
const dependencia = body.dependencia
? validar.validarTexto(body.dependencia, 'El texto dependencia.', 200)
? validar.validarTexto(body.dependencia, 'dependencia', false, 200)
: '';
const motivo = body.motivo
? validar.validarNumero(body.motivo, 'El texto motivo.', 1)
@@ -12,7 +12,7 @@ const serviciosEspeciales = async (body) => {
? { idStatus: validar.validarNumeroEntero(body.idStatus, 'id status') }
: { idStatus: { [Op.gt]: 10 } };
const nombre = body.nombre
? validar.validarTexto(body.nombre, 'El nombre', 60)
? validar.validarTexto(body.nombre, 'nombre', true, 60)
: '';
const numeroCuenta = body.numeroCuenta
? validar.validarNumeroCuenta(body.numeroCuenta)
+4 -2
View File
@@ -29,13 +29,15 @@ const update = async (body) => {
if (body.institucion)
dataUpdate.institucion = validar.validarTexto(
body.institucion,
'El texto institucion.',
'institucion',
false,
200
);
if (body.dependencia)
dataUpdate.dependencia = validar.validarTexto(
body.dependencia,
'El texto dependencia.',
'dependencia',
false,
200
);
if (body.motivo)