Skip to content

Commit

Permalink
馃悰 Fix bug when adding items in array in forged block
Browse files Browse the repository at this point in the history
Closes #1363
  • Loading branch information
baptisteArno committed Mar 19, 2024
1 parent ed5096e commit 56a23a1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions apps/builder/src/features/editor/providers/TypebotProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { PublicTypebot, PublicTypebotV6, TypebotV6 } from '@typebot.io/schemas'
import {
PublicTypebot,
PublicTypebotV6,
TypebotV6,
typebotV6Schema,
} from '@typebot.io/schemas'
import { Router } from 'next/router'
import {
createContext,
Expand Down Expand Up @@ -215,11 +220,12 @@ export const TypebotProvider = ({
}
if (dequal(omit(typebot, 'updatedAt'), omit(typebotToSave, 'updatedAt')))
return
setLocalTypebot({ ...typebotToSave })
const newParsedTypebot = typebotV6Schema.parse({ ...typebotToSave })
setLocalTypebot(newParsedTypebot)
try {
await updateTypebot({
typebotId: typebotToSave.id,
typebot: typebotToSave,
typebotId: newParsedTypebot.id,
typebot: newParsedTypebot,
})
} catch {
setLocalTypebot({
Expand Down

0 comments on commit 56a23a1

Please sign in to comment.