🐛 Remove publicId and customDomain duplication on imported bots
This commit is contained in:
@@ -56,7 +56,13 @@ export const CreateNewTypebotButtons = () => {
|
||||
mutate({
|
||||
workspaceId: workspace.id,
|
||||
typebot: {
|
||||
...(typebot ? { ...typebot } : {}),
|
||||
...(typebot
|
||||
? {
|
||||
...typebot,
|
||||
publicId: undefined,
|
||||
customDomain: undefined,
|
||||
}
|
||||
: {}),
|
||||
folderId,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -19,13 +19,12 @@ export const ImportTypebotFromFileButton = ({
|
||||
const file = e.target.files[0]
|
||||
const fileContent = await readFile(file)
|
||||
try {
|
||||
const typebot = parseInvalidTypebot(JSON.parse(fileContent))
|
||||
typebotSchema
|
||||
const typebot = typebotSchema
|
||||
.omit({
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
})
|
||||
.parse(typebot)
|
||||
.parse(parseInvalidTypebot(JSON.parse(fileContent)))
|
||||
onNewTypebot(typebot as Typebot)
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
|
||||
Reference in New Issue
Block a user