2
0

fix(viewer): 🐛 Link to public bot CORS

This commit is contained in:
Baptiste Arnaud
2022-03-10 15:33:20 +01:00
parent 30fe7b3db0
commit 9427b2a823

View File

@ -1,9 +1,13 @@
import { withSentry } from '@sentry/nextjs'
import prisma from 'libs/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { methodNotAllowed, notFound } from 'utils'
import Cors from 'cors'
import { initMiddleware, methodNotAllowed, notFound } from 'utils'
const cors = initMiddleware(Cors())
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
await cors(req, res)
if (req.method === 'GET') {
const typebotId = req.query.typebotId as string
const typebot = await prisma.publicTypebot.findUnique({