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

Pass the model to dataForCustomAction within params for enabling serialization #59

Closed
feanor07 opened this issue Jun 10, 2019 · 4 comments

Comments

@feanor07
Copy link
Contributor

There was a relevant comment regarding this one at #41 (comment)

I think it would be helpful to pass the model itself in addition to modelId to dataForCustomAction; because it is very common case to call model.serialize() in order to send the object itself as the payload just like as if model.save() is called.

@feanor07
Copy link
Contributor Author

feanor07 commented Jun 10, 2019

As of now; one needs to inject the store to relevant adapter and implement dataForCustomAction as follows:

dataForCustomAction(params) {
        return this.store.peekRecord('model_name', params.modelId).serialize()
}

it would be nicer to have this like

dataForCustomAction(params) {
        return params.model.serialize()
}

@feanor07
Copy link
Contributor Author

we can close this peacefully after the merge! thx!

@feanor07
Copy link
Contributor Author

@Exelord can we take a release with this commit included anytime soon? it is kind of urgent for us :(

@adambedford
Copy link

@feanor07 Do you have a good way of passing the model in the payload of all modelActions as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants