const URL = "/one-api/mockup/purchase/order/PurchaseOrderAset/";

export async function getListSupplier(params) {
    try {
        var response = await axios.post(URL + "getListSupplier", params)
        if (response.status !== 200) {
            return {
                status: 'ERR',
                message: responsep.statusText
            };
        }

        let data = response.data
        return data
    } catch (error) {
        return {
            status: 'ERR',
            message: error.message
        };
    }
}

export async function getListCabang(params) {
    try {
        var response = await axios.post(URL + "getListCabang", params)
        if (response.status !== 200) {
            return {
                status: 'ERR',
                message: responsep.statusText
            };
        }

        let data = response.data
        return data
    } catch (error) {
        return {
            status: 'ERR',
            message: error.message
        };
    }
}

export async function searchRequestAset(params) {
    try {
        var response = await axios.post(URL + "searchRequestAset", params)
        if (response.status !== 200) {
            return {
                status: 'ERR',
                message: responsep.statusText
            };
        }

        let data = response.data
        return data
    } catch (error) {
        return {
            status: 'ERR',
            message: error.message
        };
    }
}

export async function getUserApproveLevel(params) {
    try {
        var response = await axios.post(URL + "getUserApproveLevel", params)
        if (response.status !== 200) {
            return {
                status: 'ERR',
                message: responsep.statusText
            };
        }

        let data = response.data
        return data
    } catch (error) {
        return {
            status: 'ERR',
            message: error.message
        };
    }
}