22 lines
436 B
TypeScript
22 lines
436 B
TypeScript
![]() |
import { Result } from 'db'
|
||
|
import { sendRequest } from 'utils'
|
||
|
|
||
|
export const createResult = async (typebotId: string) => {
|
||
|
return sendRequest<Result>({
|
||
|
url: `/api/results`,
|
||
|
method: 'POST',
|
||
|
body: { typebotId },
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export const updateResult = async (
|
||
|
resultId: string,
|
||
|
result: Partial<Result>
|
||
|
) => {
|
||
|
return sendRequest<Result>({
|
||
|
url: `/api/results/${resultId}`,
|
||
|
method: 'PATCH',
|
||
|
body: result,
|
||
|
})
|
||
|
}
|