Bad_field_error

Hello,

I am facing an issue when calling Strapi ‘update’ method.

For the needs of my application, I need to link two tables content, when I update an element from the first table, I need to automatically do the same on the other one and same on the opposite.

The problem is I need to know in lifecycles (models/table_name.js) that the update call is triggered by the other table or by the admin, to do so, I added a custom parameter on the ‘update’ call method when it’s called by a table and not by the admin.

The problem is if I don’t do delete params.myCustomParameter, the update call will throw an error and not update my data at all, and I would like to avoid doing things like that.

Do you have a solution ? Or an other way to implement this ?

Thank you in advance for your help,

Thomas

Can you give a breakdown of both models and what you are trying to update. For relational content, you are correct you can’t update the data of a related entry from another.

Hello @DMehaffy ,

Sorry for the late answer, the problem coming from my bad way of designing the relations between my tables, using the existing type of relation on the content-type-builder solved my issues.

Thank you again,

Thomas

No problem :slight_smile:
Glad you figured it out