♻️ (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 { DashboardFolder } from 'db'
import { sendRequest } from 'utils'
export const createFolderQuery = async (
workspaceId: string,
folder: Pick<DashboardFolder, 'parentFolderId'>
) =>
sendRequest<DashboardFolder>({
url: `/api/folders`,
method: 'POST',
body: { ...folder, workspaceId },
})

View File

@@ -0,0 +1,7 @@
import { sendRequest } from 'utils'
export const deleteFolderQuery = async (id: string) =>
sendRequest({
url: `/api/folders/${id}`,
method: 'DELETE',
})

View File

@@ -0,0 +1,12 @@
import { Typebot } from 'db'
import { sendRequest } from 'utils'
export const patchTypebotQuery = async (
id: string,
typebot: Partial<Typebot>
) =>
sendRequest({
url: `/api/typebots/${id}`,
method: 'PATCH',
body: typebot,
})

View File

@@ -0,0 +1,12 @@
import { DashboardFolder } from 'db'
import { sendRequest } from 'utils'
export const updateFolderQuery = async (
id: string,
folder: Partial<DashboardFolder>
) =>
sendRequest({
url: `/api/folders/${id}`,
method: 'PATCH',
body: folder,
})