parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Parse Cloud function validation crashes server

Open NabilPopo opened this issue 1 year ago • 5 comments
trafficstars

Hello community,

I find a bug when I want to validate email format from input, sdsd

Also it crashed when it returns false sdsdsd

NabilPopo avatar Jul 01 '24 16:07 NabilPopo

Thanks for opening this issue!

Could you create a failing test that demonstrates the issue?

mtrezza avatar Jul 01 '24 17:07 mtrezza

Hello again,

Here I provide another basic example more simple to re-produce the problem

  1. 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 }, )

  2. the request body, try these examples: { "firstname": "", "lastname": "" } { "firstname": "sdfdf", "lastname": "" }

Like so: aa

Thank you!

NabilPopo avatar Jul 01 '24 18:07 NabilPopo

Thanks, would you want to open a PR with that test?

mtrezza avatar Jul 08 '24 21:07 mtrezza

@Priyanshu085 Sure, would you want to start by creating a PR with a failing test?

mtrezza avatar Jul 22 '24 15:07 mtrezza