2
0

feat(editor): 🔒️ Add verification on backend for file input deployment

This commit is contained in:
Baptiste Arnaud
2022-06-13 08:21:48 +02:00
parent 910b871556
commit 14afd2249e
7 changed files with 112 additions and 17 deletions

View File

@ -187,10 +187,12 @@ export const TypebotContext = ({
}
const savePublishedTypebot = async (newPublishedTypebot: PublicTypebot) => {
if (!localTypebot) return
setIsPublishing(true)
const { error } = await updatePublishedTypebot(
newPublishedTypebot.id,
newPublishedTypebot
newPublishedTypebot,
localTypebot.workspaceId
)
setIsPublishing(false)
if (error)
@ -303,10 +305,13 @@ export const TypebotContext = ({
})
} else {
setIsPublishing(true)
const { data, error } = await createPublishedTypebot({
...parseTypebotToPublicTypebot(newLocalTypebot),
id: publishedTypebotId,
})
const { data, error } = await createPublishedTypebot(
{
...parseTypebotToPublicTypebot(newLocalTypebot),
id: publishedTypebotId,
},
localTypebot.workspaceId
)
setIsPublishing(false)
if (error)
return showToast({ title: error.name, description: error.message })