2
0

🐛 Remove delete result cascade

This commit is contained in:
Baptiste Arnaud
2022-09-25 20:16:08 +02:00
committed by Baptiste Arnaud
parent 30dff2d5d7
commit 3c803b1345
11 changed files with 396 additions and 180 deletions

View File

@ -30,6 +30,17 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
members: { some: { userId: user.id, role: WorkspaceRole.ADMIN } },
},
})
await prisma.result.updateMany({
where: {
typebot: {
workspace: {
id,
members: { some: { userId: user.id, role: WorkspaceRole.ADMIN } },
},
},
},
data: { isArchived: true },
})
return res.status(200).json({
message: 'success',
})