♻️ (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 { 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 },
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
import { sendRequest } from 'utils'
|
||||
|
||||
export const deleteFolderQuery = async (id: string) =>
|
||||
sendRequest({
|
||||
url: `/api/folders/${id}`,
|
||||
method: 'DELETE',
|
||||
})
|
||||
@@ -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,
|
||||
})
|
||||
@@ -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,
|
||||
})
|
||||
Reference in New Issue
Block a user