Display a customized response

This example shows you how to display a different response following a smart action based on the number of records selected:

  • if the action is done on one company, the response is "Company is now live!"

  • if the action is done on several company, the response is "Companies are now live!"

Requirements

  • An admin backend running on forest-express-sequelize

How it works

Directory: /models

This directory contains the companies.js file where the model is declared.

Directory: /forest

This directory contains the companies.js file where the Smart Action Mark as Liveis declared.

Directory: /routes

This directory contains the companies.js file where the implementation of the route is handled. The POST /forest/actions/mark-as-live API call is triggered when you click on the Smart Action in the Forest UI.

Last updated

Was this helpful?