import { config, networkUtils } from '../../utils';

const { request } = networkUtils;
const { api } = config;
const { mdata } = api;
const { emp, changeEmpOrg } = mdata;

export async function query(params) {
  return request({
    url: emp,
    method: 'get',
    data: params,
  });
}

export async function getSingle(id) {
  return request({
    url: `${emp}/${id}`,
    method: 'get',
  });
}

export async function update(params) {
  return request({
    url: emp,
    method: 'post',
    data: params,
  });
}

export async function doUpdateOrg({ empId, orgId }) {
  return request({
    url: changeEmpOrg.replace('{empId}', empId).replace('{orgId}', orgId),
    method: 'post',
  });
}
