firestore-schema-validator icon indicating copy to clipboard operation
firestore-schema-validator copied to clipboard

email method and message

Open JSsantana opened this issue 3 years ago • 1 comments

Where the .email() comes from? How to change the error messages?

JSsantana avatar Jun 22 '21 01:06 JSsantana

@JSsantana Email uses this regex: https://github.com/bypatryk/firestore-schema-validator/blob/master/lib/filters.js#L73 You can use custom error message by providing errorMessage argument to .email(errorMessage) - https://github.com/bypatryk/firestore-schema-validator/blob/master/lib/filters.js#L71 %s will be replaced with field label (name) specified through .field(label)

bypatryk avatar Jun 24 '21 00:06 bypatryk