pasar de status 2 a status 3 listo
This commit is contained in:
@@ -13,9 +13,10 @@ const yaExiste = (campo) => {
|
||||
throw new Error(`${campo} ya se encuentra en uso.`);
|
||||
};
|
||||
|
||||
const validar = (texto, campo) => {
|
||||
const validar = (texto, campo, length) => {
|
||||
noHay(texto, campo);
|
||||
if (typeof texto !== 'string') noValido(campo);
|
||||
if (typeof texto !== 'string' || (length && texto.length > length))
|
||||
noValido(campo);
|
||||
return texto;
|
||||
};
|
||||
|
||||
@@ -69,13 +70,14 @@ const validarFecha = (fecha) => {
|
||||
return fechaMoment;
|
||||
};
|
||||
|
||||
const validarNumero = (numero) => {
|
||||
const validarNumero = (numero, length) => {
|
||||
let campo = 'El numero';
|
||||
|
||||
noHay(numero, campo);
|
||||
if (
|
||||
typeof numero !== 'string' ||
|
||||
!validator.isNumeric(numero, { no_symbols: true })
|
||||
!validator.isNumeric(numero, { no_symbols: true }) ||
|
||||
(length && numero.length > length)
|
||||
)
|
||||
noValido(campo);
|
||||
return numero;
|
||||
|
||||
Reference in New Issue
Block a user