2
0

🚧 Use TS project references

This commit is contained in:
Baptiste Arnaud
2024-08-28 18:09:35 +02:00
parent 0c7d2afd51
commit fdd6cc6fee
627 changed files with 3043 additions and 1696 deletions

View File

@@ -2,12 +2,11 @@ import {
Plan,
Prisma,
PrismaClient,
User,
Workspace,
WorkspaceRole,
} from '@typebot.io/prisma'
import { createId } from '@typebot.io/lib/createId'
import { Typebot, TypebotV6, HttpRequest } from '@typebot.io/schemas'
import { Typebot, TypebotV6 } from '@typebot.io/schemas'
import { readFileSync } from 'fs'
import { proWorkspaceId, userId } from './databaseSetup'
import {
@@ -138,19 +137,6 @@ export const createWorkspaces = async (workspaces: Partial<Workspace>[]) => {
return workspaceIds
}
export const updateUser = (data: Partial<User>) =>
prisma.user.update({
data: {
...data,
onboardingCategories: data.onboardingCategories ?? [],
displayedInAppNotifications:
data.displayedInAppNotifications ?? Prisma.DbNull,
},
where: {
id: userId,
},
})
export const createTypebots = async (partialTypebots: Partial<TypebotV6>[]) => {
const typebotsWithId = partialTypebots.map((typebot) => {
const typebotId = typebot.id ?? createId()