Association Setter (setX) not updating dataValues #17083
Unanswered
wguerram
asked this question in
Help & Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm creating associations and store them into an array. then I call a setX as the code below. I would expect the materials values to be updated with the newMaterials but old items are kept in the dataValues. The underlying tables is updated correctly.
I need to return the updated product with the new association items. I don't want to reload the data from database again.
await product.setMaterials(newMaterials, { destroyPrevious: true, });
https://sequelize.org/docs/v7/associations/has-many/#association-setter-setx
Beta Was this translation helpful? Give feedback.
All reactions