2
0

fix(dashboard): 🐛 Import from file button

This commit is contained in:
Baptiste Arnaud
2022-02-14 10:39:55 +01:00
parent 80c15f9491
commit 5a060c7f7e
4 changed files with 24 additions and 26 deletions

View File

@ -1,5 +1,3 @@
NEXT_PUBLIC_AUTH_MOCKING=enabled
PLAYWRIGHT_BUILDER_TEST_BASE_URL=http://localhost:3000
# SMTP Credentials (Generated on https://ethereal.email/)

View File

@ -15,10 +15,15 @@ import { encrypt } from 'utils'
const prisma = new PrismaClient()
export const teardownDatabase = async () => {
await prisma.user.deleteMany()
await prisma.credentials.deleteMany()
await prisma.dashboardFolder.deleteMany()
return prisma.typebot.deleteMany()
const ownerFilter = {
where: { ownerId: { in: ['freeUser', 'proUser'] } },
}
await prisma.user.deleteMany({
where: { id: { in: ['freeUser', 'proUser'] } },
})
await prisma.credentials.deleteMany(ownerFilter)
await prisma.dashboardFolder.deleteMany(ownerFilter)
return prisma.typebot.deleteMany(ownerFilter)
}
export const setupDatabase = async () => {