Skip to content

fix my typos #579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _includes/cloudcode/cloud-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ You can use an `afterSave` handler to perform lengthy operations after sending a

## Using Request Context

State can be passed from a `beforeSave` handler to an `afterSave` handler in the Reqeuest Context. The following example sends emails to users who are being added to a [Parse.Role's users relation](https://parseplatform.org/Parse-SDK-JS/api/2.1.0/Parse.Role.html#getUsers) asynchronously, so the client receives a response before the emails complete sending:
State can be passed from a `beforeSave` handler to an `afterSave` handler in the Request Context. The following example sends emails to users who are being added to a [Parse.Role's users relation](https://parseplatform.org/Parse-SDK-JS/api/2.1.0/Parse.Role.html#getUsers) asynchronously, so the client receives a response before the emails complete sending:

```javascript
const beforeSave = function beforeSave(request) {
Expand All @@ -263,7 +263,7 @@ const beforeSave = function beforeSave(request) {
const afterSave = function afterSave(request) {
const { object: role, context } = request;
if (context && context.buyers) {
const pruchasedItem = getItemFromRole(role);
const purchasedItem = getItemFromRole(role);
const promises = context.buyers.map(emailBuyer.bind(null, purchasedItem));
item.increment('orderCount', context.buyers.length);
promises.push(item.save(null, { useMasterKey: true }));
Expand Down