2
0

build(lib): 🔖 Update lib to 2.1.3

This commit is contained in:
Baptiste Arnaud
2022-03-04 17:00:30 +01:00
parent 93639c1fc6
commit 2a31b13cb3
3 changed files with 2 additions and 4 deletions

View File

@ -139,4 +139,4 @@ export const parseInitBubbleCode = ({
)
}
export const typebotJsHtml = `<script src="https://unpkg.com/typebot-js@2.1.0"></script>`
export const typebotJsHtml = `<script src="https://unpkg.com/typebot-js@2.1.3"></script>`

View File

@ -24,7 +24,7 @@ module.exports = withBundleAnalyzer({
},
{
source: '/typebot-lib/v2',
destination: 'https://unpkg.com/typebot-js@2.1.1/dist/index.umd.min.js',
destination: 'https://unpkg.com/typebot-js@2.1.3/dist/index.umd.min.js',
permanent: true,
},
]

View File

@ -14,14 +14,12 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
})
if (!typebot) return res.status(400).send({ message: 'Typebot not found' })
const limit = Number(req.query.limit)
console.log(limit, typebot.id)
const results = (await prisma.result.findMany({
where: { typebotId: typebot.id },
orderBy: { createdAt: 'desc' },
take: limit,
include: { answers: true },
})) as unknown as ResultWithAnswers[]
console.log(results)
return res.send({
results: results.map(parseAnswers(typebot as unknown as Typebot)),
})