2
0
Files
bot/apps/viewer/services/result.ts
Baptiste Arnaud 092f16d3c1 fix: 🐛 Misc
2022-05-12 07:04:43 -07:00

17 lines
427 B
TypeScript

import { Result } from 'db'
import { sendRequest } from 'utils'
export const createResult = async (typebotId: string) => {
return sendRequest<Result>({
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,
})