2
0

💄 (collaborator) Fix collab list UI

This commit is contained in:
Baptiste Arnaud
2023-02-14 17:38:32 +01:00
parent 0e5a34d5a1
commit 6e066c44e1
3 changed files with 15 additions and 9 deletions

View File

@ -15,7 +15,8 @@ import { sendGuestInvitationEmail } from 'emails'
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
const user = await getAuthenticatedUser(req)
if (!user) return notAuthenticated(res)
const typebotId = req.query.typebotId as string
const typebotId = req.query.typebotId as string | undefined
if (!typebotId) return badRequest(res)
if (req.method === 'GET') {
const invitations = await prisma.invitation.findMany({
where: { typebotId, typebot: canReadTypebots(typebotId, user) },