♻️ (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,7 @@
import { sendRequest } from 'utils'
export const deleteCollaboratorQuery = (typebotId: string, userId: string) =>
sendRequest({
method: 'DELETE',
url: `/api/typebots/${typebotId}/collaborators/${userId}`,
})

View File

@@ -0,0 +1,7 @@
import { sendRequest } from 'utils'
export const deleteInvitationQuery = (typebotId: string, email: string) =>
sendRequest({
method: 'DELETE',
url: `/api/typebots/${typebotId}/invitations/${email}`,
})

View File

@@ -0,0 +1,12 @@
import { CollaborationType } from 'db'
import { sendRequest } from 'utils'
export const sendInvitationQuery = (
typebotId: string,
{ email, type }: { email: string; type: CollaborationType }
) =>
sendRequest({
method: 'POST',
url: `/api/typebots/${typebotId}/invitations`,
body: { email, type },
})

View File

@@ -0,0 +1,13 @@
import { CollaboratorsOnTypebots } from 'db'
import { sendRequest } from 'utils'
export const updateCollaboratorQuery = (
typebotId: string,
userId: string,
collaborator: CollaboratorsOnTypebots
) =>
sendRequest({
method: 'PATCH',
url: `/api/typebots/${typebotId}/collaborators/${userId}`,
body: collaborator,
})

View File

@@ -0,0 +1,13 @@
import { Invitation } from 'db'
import { sendRequest } from 'utils'
export const updateInvitationQuery = (
typebotId: string,
email: string,
invitation: Omit<Invitation, 'createdAt' | 'id'>
) =>
sendRequest({
method: 'PATCH',
url: `/api/typebots/${typebotId}/invitations/${email}`,
body: invitation,
})