♻️ (builder) Change to features-centric folder structure
This commit is contained in:
committed by
Baptiste Arnaud
parent
3686465a85
commit
643571fe7d
@@ -0,0 +1,7 @@
|
||||
import { sendRequest } from 'utils'
|
||||
|
||||
export const deleteCollaboratorQuery = (typebotId: string, userId: string) =>
|
||||
sendRequest({
|
||||
method: 'DELETE',
|
||||
url: `/api/typebots/${typebotId}/collaborators/${userId}`,
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
import { sendRequest } from 'utils'
|
||||
|
||||
export const deleteInvitationQuery = (typebotId: string, email: string) =>
|
||||
sendRequest({
|
||||
method: 'DELETE',
|
||||
url: `/api/typebots/${typebotId}/invitations/${email}`,
|
||||
})
|
||||
@@ -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 },
|
||||
})
|
||||
@@ -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,
|
||||
})
|
||||
@@ -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,
|
||||
})
|
||||
Reference in New Issue
Block a user