import { creatRequest } from '../../utils/request.js';

const requestList = {
  // 新增受访对象
  addInvestigationUser: {
    method: 'POST',
    url: 'checkTask/saveInvestigationUser'
  },
  // 删除受访对象
  delInvestigationUser: {
    method: 'POST',
    url: 'checkTask/delInvestigationUsers'
  }
};

export const commServer = (key, data) => {
  let obj = requestList[key];
  if(key == 'delInvestigationUser'){
	  const {checkId,investigationUser} = data;
	  return creatRequest({
		  ...obj,
		  url: `checkTask/delInvestigationUsers?checkId=${checkId}&investigationUser=${investigationUser}`
	  });
  }
  return creatRequest(obj, data);
}