Pass context in beforeDelete, afterDelete, beforeFind and Parse.Cloud.run. (#6666)
* add context for following hooks. 1. beforeDelete 2. afterDelete 3. beforeFind 4. Cloud Function * revert un-necessary code change. * fix: failing test cases. * fix: failing test cases. * fix: failing test cases. * fix: failing test cases. * fix: failing test cases. * fix: failing test cases. * fix: failing test cases. * review changes * revert changes * revert changes * review changes * lint changes * review changes
This commit is contained in:
@@ -32,6 +32,7 @@ function RestWrite(
|
||||
data,
|
||||
originalData,
|
||||
clientSDK,
|
||||
context,
|
||||
action
|
||||
) {
|
||||
if (auth.isReadOnly) {
|
||||
@@ -46,18 +47,12 @@ function RestWrite(
|
||||
this.clientSDK = clientSDK;
|
||||
this.storage = {};
|
||||
this.runOptions = {};
|
||||
this.context = {};
|
||||
this.context = context || {};
|
||||
|
||||
if (action) {
|
||||
this.runOptions.action = action;
|
||||
}
|
||||
|
||||
// Parse context
|
||||
if (data._context && data._context instanceof Object) {
|
||||
this.context = data._context;
|
||||
delete data._context;
|
||||
}
|
||||
|
||||
if (!query) {
|
||||
if (this.config.allowCustomObjectId) {
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user