Skip to content
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

Pass parameter "transaction" to the Parse Server #1090

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/ParseObject.js
Expand Up @@ -1640,6 +1640,9 @@ class ParseObject {
if (options.hasOwnProperty('batchSize') && typeof options.batchSize === 'number') {
destroyOptions.batchSize = options.batchSize;
}
if (options.hasOwnProperty('transaction')) {
destroyOptions.transaction = options.transaction;
}
return CoreManager.getObjectController().destroy(
list,
destroyOptions
Expand Down Expand Up @@ -1681,6 +1684,9 @@ class ParseObject {
if (options.hasOwnProperty('batchSize') && typeof options.batchSize === 'number') {
saveOptions.batchSize = options.batchSize;
}
if (options.hasOwnProperty('transaction')) {
saveOptions.transaction = options.transaction;
}
return CoreManager.getObjectController().save(
list,
saveOptions
Expand Down
7 changes: 7 additions & 0 deletions src/RESTController.js
Expand Up @@ -21,6 +21,7 @@ export type RequestOptions = {
batchSize?: number;
include?: any;
progress?: any;
transaction?: boolean;
};

export type FullOptions = {
Expand All @@ -30,6 +31,7 @@ export type FullOptions = {
sessionToken?: string;
installationId?: string;
progress?: any;
transaction?: boolean;
};

let XHR = null;
Expand Down Expand Up @@ -230,6 +232,11 @@ const RESTController = {
}
}

const transaction = options.transaction;
if (transaction) {
payload.transaction = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to lint your code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am quite new to this and don't know what needs to be done exactly. Can you give me some advises how to get started?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just run npm run lint or yarn lint If you are using yarn in the command line.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out the Contributing Guide for all your testing and linting needs.

}

if (CoreManager.get('FORCE_REVOCABLE_SESSION')) {
payload._RevocableSession = '1';
}
Expand Down