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:
yog27ray
2020-07-11 02:17:27 +05:30
committed by GitHub
parent 4437ea73ba
commit 34614e0f78
19 changed files with 130 additions and 43 deletions

View File

@@ -5,7 +5,7 @@ const createObject = async (className, fields, config, auth, info) => {
fields = {};
}
return (await rest.create(config, auth, className, fields, info.clientSDK))
return (await rest.create(config, auth, className, fields, info.clientSDK, info.context))
.response;
};
@@ -27,12 +27,13 @@ const updateObject = async (
className,
{ objectId },
fields,
info.clientSDK
info.clientSDK,
info.context
)).response;
};
const deleteObject = async (className, objectId, config, auth, info) => {
await rest.del(config, auth, className, objectId, info.clientSDK);
await rest.del(config, auth, className, objectId, info.context);
return true;
};

View File

@@ -74,7 +74,8 @@ const getObject = async (
className,
objectId,
options,
info.clientSDK
info.clientSDK,
info.context
);
if (!response.results || response.results.length == 0) {
@@ -142,7 +143,8 @@ const findObjects = async (
className,
where,
preCountOptions,
info.clientSDK
info.clientSDK,
info.context
)
).count;
if ((skip || 0) + limit < preCount) {
@@ -222,7 +224,8 @@ const findObjects = async (
className,
where,
options,
info.clientSDK
info.clientSDK,
info.context
);
results = findResult.results;
count = findResult.count;

View File

@@ -55,7 +55,8 @@ const getUserFromSessionToken = async (
'_Session',
{ sessionToken },
options,
info.clientVersion
info.clientVersion,
info.context,
);
if (
!response.results ||