Eden Lane
12/22/2021, 6:24 PMprisma.post.update({
data: {
tags: [{
create: {
author: {
connect: {
id: authorId
}
},
tag: {
connect: {
id: tagId
}
}
}
}]
},
where: {
id: postId
}
})Maciek K
12/22/2021, 6:59 PMEden Lane
12/23/2021, 1:02 AMundefined to where clause. So it was
await prisma.tagsOnPosts.deleteMany({
where: {
postId: undefined
}
})
that's why it removed all tags from other posts 😞