Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Feature/minimum validation #20

Closed
wants to merge 4 commits into from
Closed

Conversation

ZaynJarvis
Copy link
Member

  1. if validator.js is not exported the function doesn't load.
  2. solve issues on validation should change on some field #19
  3. event constraint is too complex and I cannot determine it now.

eventbriteId: {
presence: false
}
title: {
Copy link
Member

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,
Copy link
Member

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?

Copy link
Member

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[]) => {
Copy link
Member

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;
Copy link
Member

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?

Copy link
Member

@clarencecastillo clarencecastillo Feb 16, 2019

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;
Copy link
Member

@clarencecastillo clarencecastillo Feb 16, 2019

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.

@ZaynJarvis ZaynJarvis closed this Aug 1, 2020
@ZaynJarvis ZaynJarvis deleted the feature/minimum-validation branch August 1, 2020 14:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants