Rain
04/21/2020, 7:35 AMprisma.chatroom.updateMany({ where: { founderId: { id} }, data: { members: { disconnect: {id: user.id}})
but the update many only allowed to change the chatroom property only.James Homer
04/21/2020, 8:02 AMuser.chatrooms
Rain
04/21/2020, 8:18 AMRain
04/21/2020, 8:20 AMconst allChatrooms = await this.findAll(user);
const chatrooms = { disconnect: allChatrooms.map(chatroom => ({ id: chatroom.id })) };
await this.prisma.client.user.update({
where: { id: userId },
data: { chatrooms },
});
Andrei Bacescu
06/17/2020, 1:32 PM