From 6f47efb9a1b34667a6ba64b66da8a72c7fa90874 Mon Sep 17 00:00:00 2001 From: Ali Behnamfard Date: Thu, 14 Nov 2019 05:06:02 -0500 Subject: [PATCH] Remove duplicate content --- _includes/cloudcode/cloud-code.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/_includes/cloudcode/cloud-code.md b/_includes/cloudcode/cloud-code.md index e67c98fed..433219998 100644 --- a/_includes/cloudcode/cloud-code.md +++ b/_includes/cloudcode/cloud-code.md @@ -192,16 +192,6 @@ If the function throws, the `Review` object will not be saved, and the client wi One useful tip is that even if your mobile app has many different versions, the same version of Cloud Code applies to all of them. Thus, if you launch an application that doesn't correctly check the validity of input data, you can still fix this problem by adding a validation with `beforeSave`. -If you want to use `beforeSave` for a predefined class in the Parse JavaScript SDK (e.g. [Parse.User]({{ site.apis.js }}classes/Parse.User.html)), you should not pass a String for the first argument. Instead, you should pass the class itself: - -```javascript -Parse.Cloud.beforeSave(Parse.User, (request) => { - if (!request.object.get("email")) { - throw "email is required for signup"; - } -}); -``` - ## Modifying Objects on Save In some cases, you don't want to throw out invalid data. You just want to tweak it a bit before saving it. `beforeSave` can handle this case, too. Any adjustment you make to request.object will be saved.