Skip to content

Commit

Permalink
🐛 (import) Fix import typebot files that does not have name field
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Nov 8, 2023
1 parent db17a0f commit aceba0a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ export const convertPublicTypebotToTypebot = (
resultsTablePreferences: existingTypebot.resultsTablePreferences,
selectedThemeTemplateId: existingTypebot.selectedThemeTemplateId,
whatsAppCredentialsId: existingTypebot.whatsAppCredentialsId,
events: existingTypebot.events,
events: typebot.events,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const ImportTypebotFromFileButton = ({
...typebot,
events: typebot.events ?? null,
icon: typebot.icon ?? null,
name: typebot.name ?? 'My typebot',
} as Typebot)
} catch (err) {
console.error(err)
Expand Down
2 changes: 2 additions & 0 deletions apps/builder/src/features/typebot/api/importTypebot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const omittedProps = {
workspaceId: true,
resultsTablePreferencesSchema: true,
selectedThemeTemplateId: true,
publicId: true,
} as const

const importingTypebotSchema = z.preprocess(
Expand Down Expand Up @@ -60,6 +61,7 @@ const migrateImportingTypebot = (
isClosed: false,
isArchived: false,
whatsAppCredentialsId: null,
publicId: null,
} satisfies Typebot
return migrateTypebot(fullTypebot)
}
Expand Down

2 comments on commit aceba0a

@vercel
Copy link

@vercel vercel bot commented on aceba0a Nov 8, 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-typebot-io.vercel.app
builder-v2-git-main-typebot-io.vercel.app
app.typebot.io

@vercel
Copy link

@vercel vercel bot commented on aceba0a Nov 8, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.