Search code examples
reactjsadmin-on-restreact-admin

Admin On Rest show Custom Message from server after update


After updating a row, I want to show the custom message to the user. I'm using this code: https://github.com/marmelab/admin-on-rest-demo/blob/master/src/reviews/ApproveButton.js

Admin-on-rest use Material-UI Snackbars to show Message. How can I use this to show Custom Message from Server after an update?


Solution

  • If you're also using a custom saga to handle your actions, you can dispatch a notification using the showNotification action creator.

    See the reviewSaga which works with this ApproveButton at https://github.com/marmelab/admin-on-rest-demo/blob/master/src/reviews/reviewSaga.js