import { Log, Result } from 'db' import { VariableWithValue } from 'models' import { sendRequest } from 'utils' export const createResult = async ( typebotId: string, prefilledVariables: VariableWithValue[] ) => { return sendRequest({ url: `/api/typebots/${typebotId}/results`, method: 'POST', body: { prefilledVariables }, }) } export const updateResult = async (resultId: string, result: Partial) => sendRequest({ url: `/api/typebots/t/results/${resultId}`, method: 'PATCH', body: result, }) export const createLog = ( resultId: string, log: Omit ) => sendRequest({ url: `/api/typebots/t/results/${resultId}/logs`, method: 'POST', body: log, })