♻️ (builder) Change to features-centric folder structure
This commit is contained in:
committed by
Baptiste Arnaud
parent
3686465a85
commit
643571fe7d
@@ -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,
|
||||
})
|
||||
@@ -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}`,
|
||||
})
|
||||
4
apps/builder/src/features/publish/queries/index.ts
Normal file
4
apps/builder/src/features/publish/queries/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export * from './createPublishedTypebotQuery'
|
||||
export * from './deletePublishedTypebotQuery'
|
||||
export * from './isPublicDomainAvailableQuery'
|
||||
export * from './updatePublishedTypebotQuery'
|
||||
@@ -0,0 +1,7 @@
|
||||
import { sendRequest } from 'utils'
|
||||
|
||||
export const isPublicDomainAvailableQuery = (publicId: string) =>
|
||||
sendRequest<{ isAvailable: boolean }>({
|
||||
method: 'GET',
|
||||
url: `/api/publicIdAvailable?publicId=${publicId}`,
|
||||
})
|
||||
@@ -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,
|
||||
})
|
||||
Reference in New Issue
Block a user