2
0

🧐 Improve inspectUser script

This commit is contained in:
Baptiste Arnaud
2024-01-12 11:24:41 +01:00
parent 409aeb12d3
commit 1f5559fea1
2 changed files with 6 additions and 11 deletions

View File

@ -31,6 +31,7 @@ const inspectUser = async () => {
id: true, id: true,
name: true, name: true,
plan: true, plan: true,
isVerified: true,
members: { members: {
where: { where: {
user: { email: { not: email } }, user: { email: { not: email } },

View File

@ -5,19 +5,13 @@ import * as p from '@clack/prompts'
const updateTypebot = async () => { const updateTypebot = async () => {
await promptAndSetEnvironment('production') await promptAndSetEnvironment('production')
const prisma = new PrismaClient({ const prisma = new PrismaClient()
log: [{ emit: 'event', level: 'query' }, 'info', 'warn', 'error'],
})
prisma.$on('query', (e) => { const typebotId = await p.text({
console.log(e.query)
console.log(e.params)
console.log(e.duration, 'ms')
})
const typebotId = (await p.text({
message: 'Typebot ID?', message: 'Typebot ID?',
})) as string })
if (!typebotId || p.isCancel(typebotId)) process.exit()
const typebot = await prisma.typebot.update({ const typebot = await prisma.typebot.update({
where: { where: {