Skip to content

Commit

Permalink
🚑 Fix issue when duplicating bot losing groups
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Aug 17, 2023
1 parent 304dfe2 commit 9cfca38
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions apps/builder/src/features/typebot/api/updateTypebot.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import prisma from '@/lib/prisma'
import { authenticatedProcedure } from '@/helpers/server/trpc'
import { TRPCError } from '@trpc/server'
import {
defaultSettings,
defaultTheme,
typebotSchema,
} from '@typebot.io/schemas'
import { typebotSchema } from '@typebot.io/schemas'
import { z } from 'zod'
import {
isCustomDomainNotAvailable,
Expand All @@ -15,7 +11,6 @@ import {
} from '../helpers/sanitizers'
import { isWriteTypebotForbidden } from '../helpers/isWriteTypebotForbidden'
import { isCloudProdInstance } from '@/helpers/isCloudProdInstance'
import { Plan } from '@typebot.io/prisma'

export const updateTypebot = authenticatedProcedure
.meta({
Expand Down Expand Up @@ -141,13 +136,11 @@ export const updateTypebot = authenticatedProcedure
selectedThemeTemplateId: typebot.selectedThemeTemplateId,
groups: typebot.groups
? await sanitizeGroups(existingTypebot.workspaceId)(typebot.groups)
: [],
theme: typebot.theme ? typebot.theme : defaultTheme,
: undefined,
theme: typebot.theme ? typebot.theme : undefined,
settings: typebot.settings
? sanitizeSettings(typebot.settings, existingTypebot.workspace.plan)
: defaultSettings({
isBrandingEnabled: existingTypebot.workspace.plan !== Plan.FREE,
}),
: undefined,
folderId: typebot.folderId,
variables: typebot.variables,
edges: typebot.edges,
Expand Down

1 comment on commit 9cfca38

@vercel
Copy link

@vercel vercel bot commented on 9cfca38 Aug 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app
app.typebot.io

Please sign in to comment.