parse-server
parse-server copied to clipboard
Parse Cloud function validation crashes server
Hello community,
I find a bug when I want to validate email format from input,
Also it crashed when it returns false
Thanks for opening this issue!
Could you create a failing test that demonstrates the issue?
Hello again,
Here I provide another basic example more simple to re-produce the problem
-
parse
Parse.Cloud.define("test", async(request)=>{ return 'hello' }, { fields: { firstname: { required: true, type: String, options: val => val > 2 }, lastname: { required: true, type: String, options: val => val > 2 }, gender: { required: true, type: String, options: val => ['male', 'female'].includes(val) } }, requireUser: true }, ) -
the request body, try these examples:
{ "firstname": "", "lastname": "" }{ "firstname": "sdfdf", "lastname": "" }
Like so:
Thank you!
Thanks, would you want to open a PR with that test?
@Priyanshu085 Sure, would you want to start by creating a PR with a failing test?