import request from '@/config/axios'

export const getGroupList = (params) => {
  return request.get({ url: '/portal/flow-group/page', params })
}

// 新建分组
export const createGroup = (data: any) => {
  return request.post({ url: '/portal/flow-group/create', data })
}

// 更新分组
export const updateGroup = (data: any) => {
  return request.put({ url: '/portal/flow-group/update', data })
}

// 删除分组
export const deleteGroup = (id: number) => {
  return request.delete({ url: `/portal/flow-group/delete?id=${id}` })
}

//*******************流程 */

// 获取流程列表
export const getFlowList = (params) => {
  return request.get({ url: '/portal/flow/page', params })
}

// 新建流程
export const createFlow = (data: any) => {
  return request.post({ url: '/portal/flow/create', data })
}

// 更新流程
export const updateFlow = (data: any) => {
  return request.put({ url: '/portal/flow/update', data })
}

// 删除流程
export const deleteFlow = (id: number) => {
  return request.delete({ url: `/portal/flow/delete?id=${id}` })
}
