Update 3.0.0.md (#5038)
In example, the parameter is called request but in the function it was calling req
This commit is contained in:
4
3.0.0.md
4
3.0.0.md
@@ -13,7 +13,7 @@ In order to leverage those new nodejs features, you'll need to run at least node
|
||||
```js
|
||||
// before
|
||||
Parse.Cloud.beforeSave('MyClassName', function(request, response) {
|
||||
if (!passesValidation(req.object)) {
|
||||
if (!passesValidation(request.object)) {
|
||||
response.error('Ooops something went wrong');
|
||||
} else {
|
||||
response.success();
|
||||
@@ -22,7 +22,7 @@ Parse.Cloud.beforeSave('MyClassName', function(request, response) {
|
||||
|
||||
// after
|
||||
Parse.Cloud.beforeSave('MyClassName', (request) => {
|
||||
if (!passesValidation(req.object)) {
|
||||
if (!passesValidation(request.object)) {
|
||||
throw 'Ooops something went wrong';
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user