🚸 (dashboard) Add unpublish menu item in dashboard
Also remove the useless publishedTypebotId field in Typebot Closes #232
This commit is contained in:
@@ -29,7 +29,7 @@ import { integrationsList } from './embeds/EmbedButton'
|
||||
|
||||
export const SharePage = () => {
|
||||
const { workspace } = useWorkspace()
|
||||
const { typebot, updateTypebot } = useTypebot()
|
||||
const { typebot, updateTypebot, publishedTypebot } = useTypebot()
|
||||
const { showToast } = useToast()
|
||||
|
||||
const handlePublicIdChange = async (publicId: string) => {
|
||||
@@ -39,7 +39,7 @@ export const SharePage = () => {
|
||||
const publicId = typebot
|
||||
? typebot?.publicId ?? parseDefaultPublicId(typebot.name, typebot.id)
|
||||
: ''
|
||||
const isPublished = isDefined(typebot?.publishedTypebotId)
|
||||
const isPublished = isDefined(publishedTypebot)
|
||||
|
||||
const handlePathnameChange = (pathname: string) => {
|
||||
if (!typebot?.customDomain) return
|
||||
|
||||
@@ -2,7 +2,7 @@ import { PublicTypebot } from 'models'
|
||||
import { sendRequest } from 'utils'
|
||||
|
||||
export const createPublishedTypebotQuery = async (
|
||||
typebot: PublicTypebot,
|
||||
typebot: Omit<PublicTypebot, 'id'>,
|
||||
workspaceId: string
|
||||
) =>
|
||||
sendRequest<PublicTypebot>({
|
||||
|
||||
@@ -20,7 +20,6 @@ export const parsePublicTypebotToTypebot = (
|
||||
customDomain: existingTypebot.customDomain,
|
||||
createdAt: existingTypebot.createdAt,
|
||||
updatedAt: existingTypebot.updatedAt,
|
||||
publishedTypebotId: typebot.id,
|
||||
folderId: existingTypebot.folderId,
|
||||
icon: existingTypebot.icon,
|
||||
workspaceId: existingTypebot.workspaceId,
|
||||
|
||||
Reference in New Issue
Block a user