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
Add support for extra parameters to Model.save() & RecordArray.save() #2310
Conversation
The Travis build is failing for some other reason... 😿 |
I restarted the build, it now seems to fail due to the tests you added. |
Oops... Indeed, this time it was me: was running in the browser, but not on command-line. Fixed 😅 |
@MikeAski: Can you explain what kind of extra context data/metadata you need to include with the save? In general, we try to avoid APIs like this that serve as sidechannels to allow disparate parts of the system to communicate. |
Perhaps something like an Here is an example from the Stripe API[1]. We've got similar ones in ours. High-level example of how a solution could work.
For things like this we currently do an out-of-band plain xhr, and then use Naming is tentative, I'm not sure 'operation' is the ideal word here. [1] The Strips API has a bunch of these, https://stripe.com/docs/api/curl#refund_charge |
@tomdale My need is to address a legacy API, which has extra behaviour flags passed along with resource attributes. The exact case is user profile update, which takes two flags indicating if the admin wishes to have the updated user's password randomly generated & another indicating if anyway some notification should be sent to the given user. @sandstrom In my case, I am needing the extra parameters on CRUD actions. So I think your suggestion is interesting but is another topic 😉 |
@MikeAski Perhaps you can use readonly attributes |
@sandstrom It worked, indeed. I had to override |
This is especially useful when having to pass extra context data to the server, along with a standard resource action.