import { http } from '@/utils/http/axios'
import type { ApprovalParam, PageParam } from '/#/api'

/**
 * 获取审核列表
 * @returns
 */
export async function getApprovalList(params: PageParam, assigneeId: string) {
  const res = await http.request({
    url: `/flow/task/listdata`,
    method: 'get',
    params,
  })

  const { data: { list, totalPage } } = res
  return {
    pageCount: totalPage,
    data: list,
  }
}

/**
 * 审核
 * @param param
 */
export async function approval(params: ApprovalParam) {
  return http.request({
    url: `/flow/task/completeFlow`,
    method: 'post',
    params,
  })
}
