2
0

🧰 Aggregate utils & set up results collection in viewer

This commit is contained in:
Baptiste Arnaud
2021-12-29 10:22:26 +01:00
parent 447172d0cb
commit f088f694b9
42 changed files with 404 additions and 141 deletions

View File

@ -0,0 +1,21 @@
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,
})
}