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

Provide request.original object to afterSave hook as per real Parse Server behaviour #92

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

darrenkidd
Copy link

@darrenkidd darrenkidd commented Nov 9, 2020

This is my proposed fix for #91.

Happy to remove some of the extra test scripts and documentation; wanted them there to start with so I couldn't lose them and so others could see the full source.

All tests were passing when I pushed.

EDIT: motivation for this is that I have an afterSave hook that relies on identifying when a particular value has been incremented. Without this fix it's impossible for me to unit test that behaviour, so thought I'd give it a go.

Rather than have beforeSave do a manual look up of the object
in the collection, this approach leaves all of that to handlePutRequest,
which is the only method that deals in updates (vs creates).
@darrenkidd darrenkidd changed the title After save request original object Provide request.original object to afterSave hook as per real Parse Server behaviour Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant