17 lines
465 B
TypeScript
17 lines
465 B
TypeScript
import { Result } from 'db'
|
|
import { sendRequest } from 'utils'
|
|
|
|
export const createResult = async (typebotId: string) => {
|
|
return sendRequest<{ result: Result; hasReachedLimit: boolean }>({
|
|
url: `/api/typebots/${typebotId}/results`,
|
|
method: 'POST',
|
|
})
|
|
}
|
|
|
|
export const updateResult = async (resultId: string, result: Partial<Result>) =>
|
|
sendRequest<Result>({
|
|
url: `/api/typebots/t/results/${resultId}`,
|
|
method: 'PATCH',
|
|
body: result,
|
|
})
|