🐛 (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,
|
resultsTablePreferences: existingTypebot.resultsTablePreferences,
|
||||||
selectedThemeTemplateId: existingTypebot.selectedThemeTemplateId,
|
selectedThemeTemplateId: existingTypebot.selectedThemeTemplateId,
|
||||||
whatsAppCredentialsId: existingTypebot.whatsAppCredentialsId,
|
whatsAppCredentialsId: existingTypebot.whatsAppCredentialsId,
|
||||||
events: existingTypebot.events,
|
events: typebot.events,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ export const ImportTypebotFromFileButton = ({
|
|||||||
...typebot,
|
...typebot,
|
||||||
events: typebot.events ?? null,
|
events: typebot.events ?? null,
|
||||||
icon: typebot.icon ?? null,
|
icon: typebot.icon ?? null,
|
||||||
|
name: typebot.name ?? 'My typebot',
|
||||||
} as Typebot)
|
} as Typebot)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
|
@ -27,6 +27,7 @@ const omittedProps = {
|
|||||||
workspaceId: true,
|
workspaceId: true,
|
||||||
resultsTablePreferencesSchema: true,
|
resultsTablePreferencesSchema: true,
|
||||||
selectedThemeTemplateId: true,
|
selectedThemeTemplateId: true,
|
||||||
|
publicId: true,
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
const importingTypebotSchema = z.preprocess(
|
const importingTypebotSchema = z.preprocess(
|
||||||
@ -60,6 +61,7 @@ const migrateImportingTypebot = (
|
|||||||
isClosed: false,
|
isClosed: false,
|
||||||
isArchived: false,
|
isArchived: false,
|
||||||
whatsAppCredentialsId: null,
|
whatsAppCredentialsId: null,
|
||||||
|
publicId: null,
|
||||||
} satisfies Typebot
|
} satisfies Typebot
|
||||||
return migrateTypebot(fullTypebot)
|
return migrateTypebot(fullTypebot)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user