,
one of the field is country which is referenced to countries table like below
{
field: ‘Country’,
reference: ‘countries.id’,
isRequired: true,
}
i have onChange hook on some other field ‘owner’. When i change the owner its throwing error as ’ type of "Country" on the smart action "Place Order" must be a valid type. See the documentation for more information’ and the payload is like this (forest-screenshot-2).
We have different environments in forest dev, staging and Production. With same code changes this behavior is working as expected in dev but not in staging and production. what could be the issue? I believe forest version would be same in all environments.
Expected behavior
type should be picked up automatically
as it is working in other environments
(forest-screenshot-3-expected-payload)
To be able to help you further I will need you to fill these information:
Project name: …
Team name: …
Environment name: …
Agent technology: (nodejs, php, rails, python)
Agent (forest package) name & version: …
Database type: …
Recent changes made on your end if any: …
Project name: Monta
Team name: …
Environment name: Issue facing in Staging and Production, In dev working fine
Agent technology: nodejs
Agent (forest package) name & version: …
“forest-cli”: “^4.3.2”,
“forest-express-sequelize”: “^9.3.11”
Database type: Mysql
hi @shohanr
thanks for responding. here is the smart action code…
{
name: ‘Place Order’,
type: ‘global’,
endpoint: ‘/forest/actions/place-order’,
fields:[
{
field: ‘Autofill From a Previous Order’,
description: ‘Optional. You will still be able to update all fields’,
type: ‘String’,
reference: ‘orders.id’,
isRequired: false,
hook: ‘onCopyChange’,
},
{
field: ‘Owner’,
description: ‘Owner of the order’,
type: ‘Enum’,
enums: [‘User’, ‘Operator’],
isRequired: true,
hook: ‘onOwnerChange’
},
{
field: ‘Country’,
reference: ‘countries.id’,
isRequired: true,
}
],