Skip to content

How do I access to beforeSave's request and response objects? #5

@fatuhoku

Description

@fatuhoku

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions