Expected behavior
I expect that when I change value in a field, change hook will be called.
Load hook works properly but chage hook does not.
Actual behavior
Ony change, forest admin tells me to check the error on my server logs
but all I see is the following failure logs:
Failure Logs
POST /forest/actions/create/hooks/change?timezone=Europe%2FKiev 413 93 - 0.765 ms
Context
“dependencies”: {
“axios”: “^0.21.1”,
“body-parser”: “1.19.0”,
“chalk”: “~1.1.3”,
“cookie-parser”: “1.4.4”,
“cors”: “2.8.5”,
“debug”: “~4.0.1”,
“dotenv”: “~6.1.0”,
“express”: “~4.17.1”,
“express-jwt”: “6.0.0”,
“forest-express-sequelize”: “^7.0.0”,
“morgan”: “1.9.1”,
“pg”: “~8.2.2”,
“require-all”: “^3.0.0”,
“sequelize”: “~5.15.1”
}
Database : postgres 13.2
collection('feeRules', {
actions: [
{
name: "Create",
type: "single",
httpMethod: "POST",
fields: [
{
field: InputFields[`Consultant specialties filter`],
description: `Input approximate specialty name to reduce number of results below`,
type: "String",
isRequired: false,
}],
hooks: {
change: {
[InputFields["Consultant specialties filter"]]: ({fields, record}) => {
console.log(`Here !!!!!`);
return fields;
}
}