Hi @Sliman_Medini
ok, thank you for your suggestion.
We are progressing…
I started adding the console.log(fields)
to my load function in my vusers
collection, and nothing was logged, so I didn’t understand what was wrong.
After that, I remembered that I have exactly the same smart action name in another collection named vusers_monitorings
, which points to the same endpoint.
Let’s see:
Liana.collection('users', {
actions: [
...
{ name: 'Mail request user action',
type: 'bulk',
endpoint: 'forest/actions/mails/request_user_action',
fields: [{
field: 'Mail_template',
...
}],
hooks: {
load: ({ fields /* , request */ }) => {
console.log('******** users ***************');
console.log(fields);
...
},
},
},
...
},
],
});
and for the other collection:
Liana.collection('vuser_monitorings', {
actions: [
...
{ name: 'Mail request user action',
type: 'bulk',
endpoint: 'forest/actions/mails/request_user_action',
fields: [{
field: 'Mail_template',
...
}],
hooks: {
load: ({ fields /* , request */ }) => {
console.log('******** vuser_monitorings ***************');
console.log(fields);
...
},
},
},
...
},
],
});
And the result:
- in
Development
environment, the log of users is displayed correctly.
- in
Staging
environment, the log of vuser_monitorings is displayed when I am activating the action in users
collection.
That is the source of the problem.
==> the wrong load hook is called when two smart actions have the same name in two different collections.
It explains my issue, because my Dummy item
was added in the users
collection only.
Could you please try this scenario and let me know if you are able to reproduce this issue?
Reminder: for me, it happens only in Staging, and Production (not in Development).
Thanks in advance.