#5878 - FiscalData Validations #108

Merged
jsegarra merged 9 commits from 5858-fiscalData-validations into dev 2024-02-07 09:31:47 +00:00
1 changed files with 6 additions and 6 deletions
Showing only changes of commit 4ccb11997e - Show all commits
src/composables

View File

@ -30,14 +30,14 @@ export function useValidator() {
const { t } = useI18n();
const validations = function (validation) {
return {
format: (value) =>{
const {allowNull, with: format, allowBlank} = validation;
format: (value) => {
const { allowNull, with: format, allowBlank } = validation;
const message = t(validation.message) || validation.message;
if(!allowBlank && value ==='') return message
if(!allowNull && value === null) return message
if (!allowBlank && value === '') return message;
if (!allowNull && value === null) return message;
const isValid = new RegExp(format).test(value)
if(!isValid) return message
const isValid = new RegExp(format).test(value);
if (!isValid) return message;
jsegarra marked this conversation as resolved Outdated
Outdated
Review

Tienes instalado eslint, el código no respeta las reglas: falta punto y coma al final de las líneas, espacio despues del if...

Tienes instalado eslint, el código no respeta las reglas: falta punto y coma al final de las líneas, espacio despues del if...

He corregido el problema, y anotado la causa del error para comentar en la próxima reunión.

He corregido el problema, y anotado la causa del error para comentar en la próxima reunión.
},
presence: (value) => {
let message = `Value can't be empty`;