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:
llino
2018-09-08 13:20:34 +01:00
committed by Florent Vilmart
parent 462f5eb54b
commit fefecfeb9a

View File

@@ -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';
}
});