vk
DTDrizzle Team
•Created by vk on 10/8/2024 in #help
Updating many-to-many best practice
Hi,
Im currently working on an admin dashboard for my schemas. I reached the point to where I have to update a many-to-many relation. Take for instance a
User
model, that can belong to different Groups
. In my admin dashboard, I have a edit user form that posts the new groups that should be related to the user. How do I update this m2m relation in the most efficient way? Do I find the diffs between the old and new groups and then do a delete/insert based on the diff? Do drizzle do any of this "out of the box" with a method I dont know about?`1 replies