Hey guys,
I would like to implement a smart action that is similar to the one you have in your documentation: Create and manage Smart Actions - Documentation
However, I would like to make it as “conditional smart action” where i could either set it as “alive” or the reverse, set it as “dead”.
The thing is, if my item is marked as “alived”, i should then have a smart action with “Mark as Dead”, and so the reverse when this one isn’t alived
As “possible” example (using the doc mentioned above):
const { collection } = require('forest-express-mongoose');
collection('companies', {
actions: [{
name: item.IsAlived ? "Mark as Dead" : "Mark as Alive"
}],
});
Otherwise, if this isn’t possible, could I at least have action depending on a value? so I either put an action or the other? As of today, i have the following:
actions: [
{
name: 'Mark as alive',
endpoint: '/forest/item/markAsAlive',
httpMethod: 'POST'
},
{
name: 'Mark as dead',
endpoint: '/forest/item/markAsDead',
httpMethod: 'POST'
},
]
I hope I am clear I will be checking this topic time to time, feel free to ask more details
best!
Max