refs #5878 lint: eslint

This commit is contained in:
Javier Segarra 2023-12-22 10:32:57 +01:00
parent 1dfe071b7e
commit 4ccb11997e
1 changed files with 6 additions and 6 deletions

View File

@ -30,14 +30,14 @@ export function useValidator() {
const { t } = useI18n(); const { t } = useI18n();
const validations = function (validation) { const validations = function (validation) {
return { return {
format: (value) =>{ format: (value) => {
const {allowNull, with: format, allowBlank} = validation; const { allowNull, with: format, allowBlank } = validation;
const message = t(validation.message) || validation.message; const message = t(validation.message) || validation.message;
if(!allowBlank && value ==='') return message if (!allowBlank && value === '') return message;
if(!allowNull && value === null) return message if (!allowNull && value === null) return message;
const isValid = new RegExp(format).test(value) const isValid = new RegExp(format).test(value);
if(!isValid) return message if (!isValid) return message;
}, },
presence: (value) => { presence: (value) => {
let message = `Value can't be empty`; let message = `Value can't be empty`;