// 审批接口
import request from './index'
const approvalType: { [key: string]: string } = {
  agree: '/approval/operate/agree',
  refuse: '/approval/operate/refuse',
  reject: '/approval/operate/reject',
  revoke: '/approval/operate/revoke',
}
// 审批操作接口
export function submitApproval(type: string, data: { taskId: string; comments: string }) {
  return request({
    url: approvalType[type],
    method: 'post',
    data,
  })
}
// 查询审批记录
export function fetchApproval(processId: string) {
  return request({
    url: '/approval/operate/approvalLog',
    method: 'get',
    params: { processId },
  })
}
