import client from '../client' ; import { AxiosRequestConfig } from 'axios' ; export interface CreateArgs { taskId : string ; approval : Record < string , any > ; } export async function approvalCreateForTask ( opts , context ) { const { taskId , approval } = opts || { } ; if ( ! taskId ) throw new Error ( 'You should provide `taskId`' ) ; const res = await client . post ( `/tasks/${ taskId }/approvals` , approval , context ) ; return res ?. data ?. data [ 0 ] ; }