
import {
    WeaTools
} from 'ecCom'

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

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

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

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

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

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

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