♻️ (builder) Change to features-centric folder structure

This commit is contained in:
Baptiste Arnaud
2022-11-15 09:35:48 +01:00
committed by Baptiste Arnaud
parent 3686465a85
commit 643571fe7d
683 changed files with 3907 additions and 3643 deletions

View File

@@ -0,0 +1,12 @@
import { PublicTypebot } from 'models'
import { sendRequest } from 'utils'
export const createPublishedTypebotQuery = async (
typebot: PublicTypebot,
workspaceId: string
) =>
sendRequest<PublicTypebot>({
url: `/api/publicTypebots?workspaceId=${workspaceId}`,
method: 'POST',
body: typebot,
})

View File

@@ -0,0 +1,13 @@
import { sendRequest } from 'utils'
export const deletePublishedTypebotQuery = ({
publishedTypebotId,
typebotId,
}: {
publishedTypebotId: string
typebotId: string
}) =>
sendRequest({
method: 'DELETE',
url: `/api/publicTypebots/${publishedTypebotId}?typebotId=${typebotId}`,
})

View File

@@ -0,0 +1,4 @@
export * from './createPublishedTypebotQuery'
export * from './deletePublishedTypebotQuery'
export * from './isPublicDomainAvailableQuery'
export * from './updatePublishedTypebotQuery'

View File

@@ -0,0 +1,7 @@
import { sendRequest } from 'utils'
export const isPublicDomainAvailableQuery = (publicId: string) =>
sendRequest<{ isAvailable: boolean }>({
method: 'GET',
url: `/api/publicIdAvailable?publicId=${publicId}`,
})

View File

@@ -0,0 +1,13 @@
import { PublicTypebot } from 'models'
import { sendRequest } from 'utils'
export const updatePublishedTypebotQuery = async (
id: string,
typebot: Omit<PublicTypebot, 'id'>,
workspaceId: string
) =>
sendRequest({
url: `/api/publicTypebots/${id}?workspaceId=${workspaceId}`,
method: 'PUT',
body: typebot,
})