ForestAdmin / forest-express-mongoose

🌱 ExpressJS/Mongoose agent for Forest Admin to integrate directly to your existing ExpressJS/Mongoose backend application.
https://www.forestadmin.com
GNU General Public License v3.0
193 stars 28 forks source link

Call action after insertion #129

Closed laruche closed 5 years ago

laruche commented 6 years ago

There is a way to call a server side action after insertion ?

When I use forestadmin to insert data on my database, I would like to call my server for create another thing (API Call) There is an automatic way to do this ? without create all server routine ?

arnaudbesnier commented 5 years ago

Hi @laruche,

One option could be to use Smart Routes to override native ForestAdmin action (insert in your cases). See the documentation: https://docs.forestadmin.com/documentation/reference-guide/routes#what-is-a-smart-route

A second option could be to create a Smart Action dedicated for your data insertion. See the documentation: https://docs.forestadmin.com/documentation/reference-guide/actions#what-is-an-action

A third option would be to use the hooks of the ORM to trigger something on insert (but it would be generic and not specific to your admin usage).

Let me close this issue, feel free to reopen it if necessary.