You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like ParseMockDB.registerHook expects a promise, even though regular Cloud Code beforeX handlers are of type function(request,response). The contract should be identical to Cloud Code's for fidelity. callbacks are a pain!
EDIT: Okay, instead of function(request,response), how about we replace the response part with promise syntax, but leave the request as a parameter: i.e. function(request).
Check the Parse.Object docs. Most *Request types are the same as each other and the *Response types are the same as each other too:
Note: some assumptions have to be made about the masterKey.
The text was updated successfully, but these errors were encountered:
fatuhoku
changed the title
How do I access to beforeSave request and response objects?
How do I access to beforeSave's request and response objects, as well as afterSave's request object?
Dec 10, 2015
fatuhoku
changed the title
How do I access to beforeSave's request and response objects, as well as afterSave's request object?
How do I access to beforeSave's request and response objects?
Dec 10, 2015
It looks like
ParseMockDB.registerHook
expects a promise, even though regular Cloud Code beforeX handlers are of typefunction(request,response)
.The contract should be identical to Cloud Code's for fidelity.callbacks are a pain!EDIT: Okay, instead of
function(request,response)
, how about we replace theresponse
part with promise syntax, but leave therequest
as a parameter: i.e.function(request)
.Check the Parse.Object docs. Most
*Request
types are the same as each other and the *Response
types are the same as each other too:Parse.Cloud.AfterDeleteRequest
Parse.Cloud.AfterSaveRequest
Parse.Cloud.BeforeDeleteRequest
Parse.Cloud.BeforeDeleteResponse
Parse.Cloud.BeforeSaveRequest
Parse.Cloud.BeforeSaveResponse
Note: some assumptions have to be made about the
masterKey
.The text was updated successfully, but these errors were encountered: