forked from verdnatura/salix-front
feat: required validation
This commit is contained in:
parent
8798598f41
commit
fb2e3f1f9c
|
@ -46,6 +46,9 @@ export function useValidator() {
|
|||
|
||||
return !validator.isEmpty(value ? String(value) : '') || message;
|
||||
},
|
||||
required: (required, value) => {
|
||||
return required ? !!value || t('globals.fieldRequired') : null;
|
||||
},
|
||||
length: (value) => {
|
||||
const options = {
|
||||
min: validation.min || validation.is,
|
||||
|
@ -78,11 +81,9 @@ export function useValidator() {
|
|||
custom: (value) => validation.bindedFunction(value) || 'Invalid value',
|
||||
};
|
||||
};
|
||||
// const requiredFieldRule = [(val) => validations({}).presence(val)];
|
||||
|
||||
return {
|
||||
validate,
|
||||
// requiredFieldRule,
|
||||
validations,
|
||||
models,
|
||||
};
|
||||
|
|
|
@ -67,6 +67,7 @@ globals:
|
|||
allRows: 'All { numberRows } row(s)'
|
||||
markAll: Mark all
|
||||
requiredField: Required field
|
||||
valueCantBeEmpty: Value cannot be empty
|
||||
class: clase
|
||||
type: Type
|
||||
reason: reason
|
||||
|
@ -75,7 +76,7 @@ globals:
|
|||
notificationSent: Notification sent
|
||||
warehouse: Warehouse
|
||||
company: Company
|
||||
fieldRequired: Field requdired
|
||||
fieldRequired: Field required
|
||||
allowedFilesText: 'Allowed file types: { allowedContentTypes }'
|
||||
smsSent: SMS sent
|
||||
confirmDeletion: Confirm deletion
|
||||
|
|
Loading…
Reference in New Issue