2
0

🐛 Fix listing deleted bots on Zapier and Make.com

This commit is contained in:
Baptiste Arnaud
2024-01-29 18:49:56 +01:00
parent 3ab84b7555
commit 07928c743c

View File

@ -8,7 +8,10 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
const user = await authenticateUser(req) const user = await authenticateUser(req)
if (!user) return res.status(401).json({ message: 'Not authenticated' }) if (!user) return res.status(401).json({ message: 'Not authenticated' })
const typebots = await prisma.typebot.findMany({ const typebots = await prisma.typebot.findMany({
where: { workspace: { members: { some: { userId: user.id } } } }, where: {
workspace: { members: { some: { userId: user.id } } },
isArchived: { not: true },
},
select: { select: {
name: true, name: true,
publishedTypebot: { select: { id: true } }, publishedTypebot: { select: { id: true } },