I want to fix my PUT method on prisma to update all plans connections when updating my checkout
this.connection.update({
where: { id },
data: {
name,
description,
picture,
updatedAt: new Date(),
plans: {
connect: plans.map((id) => ({ id })),
},
},
include: {
plans: true,
},
});
my update is like this, but i found a problem: When i pass on the request an array of plans ID's with less plans (deleting) it doesnt delete the ones i already have connected. I know there is the disconect, but there is a way to update all connects when passing that data? What i mean is: i want to full replace the connections of the plan when updating it.
Thnks!