2
0

🐛 (import) Fix import typebot files that does not have name field

This commit is contained in:
Baptiste Arnaud
2023-11-08 16:42:59 +01:00
parent db17a0f508
commit aceba0abd0
3 changed files with 4 additions and 1 deletions

View File

@ -26,6 +26,6 @@ export const convertPublicTypebotToTypebot = (
resultsTablePreferences: existingTypebot.resultsTablePreferences,
selectedThemeTemplateId: existingTypebot.selectedThemeTemplateId,
whatsAppCredentialsId: existingTypebot.whatsAppCredentialsId,
events: existingTypebot.events,
events: typebot.events,
}
}

View File

@ -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)

View File

@ -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)
}