-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
ZaynJarvis
commented
Feb 14, 2019
- if validator.js is not exported the function doesn't load.
- solve issues on validation should change on some field #19
- event constraint is too complex and I cannot determine it now.
eventbriteId: { | ||
presence: false | ||
} | ||
title: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change this to indentation using 4 spaces? I know this is linting issue again 🤣
presence: { allowEmpty: false } | ||
}, | ||
websiteUrl: { | ||
presence: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need presence: false
here now that we have the urlAllowEmpty
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applies to other validation files.
@@ -34,3 +34,10 @@ validators.array = (value: any[], options: ArrayValidatorOptions, key: string, a | |||
validators.object = (value: any, options: MapValidatorOptions, key: string, attributes: any) => { | |||
return validate(value, options.constraints); | |||
}; | |||
|
|||
validators.urlAllowEmpty = (values: any, ...others: any[]) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice. A bit disappointing the library does not support it by default.
return validators.url(values, ...others); | ||
}; | ||
|
||
export default validate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot about this one. Wouldn't have worked without this aye?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, XXXexists in the repositories also add custom validators. In that case, they should also be exported there and imported here. Not sure with this one.
return validators.url(values, ...others); | ||
}; | ||
|
||
export default validate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, XXXexists in the repositories also add custom validators. In that case, they should also be exported there and imported here. Not sure with this one.