🐛 (import) Fix import typebot files that does not have name field
This commit is contained in:
@ -26,6 +26,6 @@ export const convertPublicTypebotToTypebot = (
|
||||
resultsTablePreferences: existingTypebot.resultsTablePreferences,
|
||||
selectedThemeTemplateId: existingTypebot.selectedThemeTemplateId,
|
||||
whatsAppCredentialsId: existingTypebot.whatsAppCredentialsId,
|
||||
events: existingTypebot.events,
|
||||
events: typebot.events,
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -27,6 +27,7 @@ const omittedProps = {
|
||||
workspaceId: true,
|
||||
resultsTablePreferencesSchema: true,
|
||||
selectedThemeTemplateId: true,
|
||||
publicId: true,
|
||||
} as const
|
||||
|
||||
const importingTypebotSchema = z.preprocess(
|
||||
@ -60,6 +61,7 @@ const migrateImportingTypebot = (
|
||||
isClosed: false,
|
||||
isArchived: false,
|
||||
whatsAppCredentialsId: null,
|
||||
publicId: null,
|
||||
} satisfies Typebot
|
||||
return migrateTypebot(fullTypebot)
|
||||
}
|
||||
|
Reference in New Issue
Block a user