
import {
    WeaTools
} from 'ecCom'

export const getSearchList = (params) => {
    return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTable', 'GET', params);
}

export const deleteTableData = (params) => {
    //return WeaTools.callApi('/api/bs/hrmorganization/scheme/deleteByIds', 'POST', params);
    return fetch('/api/bs/hrmorganization/scheme/deleteByIds', {
        method: 'POST',
        mode: 'cors',
        headers: {
            'Content-Type': 'application/json'
        }, 
        body: JSON.stringify(params)
    })
}

export const getAdvanceSearchCondition = (params) => {
    return WeaTools.callApi('/api/bs/hrmorganization/scheme/getSearchCondition', 'GET', params);
}

export const add = (params) => {
    //return WeaTools.callApi('/api/bs/hrmorganization/scheme/save', 'POST', params);
    return fetch('/api/bs/hrmorganization/scheme/save', {
        method: 'POST',
        mode: 'cors',
        headers: {
            'Content-Type': 'application/json'
        }, 
        body: JSON.stringify(params)
    })
}

export const edit = (params) => {
    return fetch('/api/bs/hrmorganization/scheme/updateScheme', {
        method: 'POST',
        mode: 'cors',
        headers: {
            'Content-Type': 'application/json'
        }, 
        body: JSON.stringify(params)
    })
}

export const updateForbiddenTag = (params) => {
    return fetch('/api/bs/hrmorganization/scheme/updateForbiddenTagById', {
        method: 'POST',
        mode: 'cors',
        headers: {
            'Content-Type': 'application/json'
        }, 
        body: JSON.stringify(params)
    })
}

export const getSchemeForm = (params) => {
    return WeaTools.callApi('/api/bs/hrmorganization/scheme/getSchemeForm', 'GET', params);
}

export const getHasRight = (params) => {
    return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTableBtn', 'GET', params);
}